alright kid... i have a hosting corporation.. go and learn something before you just write something wrong..
Anyway the server must send this file to the client.. if u mean process usage of the CPU its less that u can think in a server
and sure client can do this.. why not tuff guy?? what term are you talking about? KID:))
alright i know you are a MODERATOR :))
User Profile
Collapse
Profile Sidebar
Collapse
pezhvak
Banned
Last Activity: Oct 28 '09, 04:17 PM
Joined: Jul 5 '09
Location:
-
-
-
this line is wrong:
Code:if(isset($_POST['Submit']) && $_POST['Submit'] == "Submit")
Code:if(isset($_POST['Submit'])) if($_POST['Submit'] == "Submit")
in the first IF we check if "Submit" is set or not and in the second IF we check if value of "Submit" field are equal with "Submit" string or not
...Leave a comment:
-
TIP: use GD to show your pictures to customers..
if want to resize the largest picture in IMG tag (by using width & height attributes) it will bring down customer speed, so upload your largest picture (the 5200 x 4048 one..), and use GD to re size your picture
if you don't know anything about GD use following link: http://php.net/GDLeave a comment:
-
-
it's all about your PHP.ini file, you have to change your memory_limit & post_max_size and also upload_max_file size that is required to be changed, in default the value of upload_max_file size is 5mb, change it to 2000mb or more... so your script will work againLeave a comment:
-
Hi jeddiki,
everything is fine here,
no, I have finished the school,
Next month i will start university..
i will be really happy to help you resolve your problems, tell me whenever you had any problems ;) -
Hi pezhvak,
How you doing ?
What do you do in Tehran? Student ?
Thanks for your help with my thread.
I have a couple of others going at the moment -
just thought I would tell you, in case you are bored and want to solve a problem ;-) -
Your welcome ;)
if you had any questions, feel free to ask me :)Leave a comment:
-
Alright, here you are:
Code:<?php $handle1 = fopen("geotext_1a.csv", "r"); $handle2 = fopen("geo_sm_1a.csv", "w"); while ($data = fgetcsv($handle1, ",")) { if(count($data) >= 5) { $country = strpos($data[5], ",") ? substr($data[5],0,strpos($data[5], ",")) : $data[5]; $row = $data[2]."[,]".$data[3]."[,]".trim($country);
Leave a comment:
-
Aha! i think i know what is the problem!!
Do you remember the empty lines in your CSV file?
that's the problem, as i said, fgetcsv will explode the line by ',' character.
in other hand there is no ',' character in the empty lines, so we don't have $data[1-5] indexes, so it will show those notices,
So, i update the script again:
Code:<?php $handle1 = fopen("geotext_1a.csv", "r");
Leave a comment:
-
as your request i checked your script again,
Your problem was:
1- in the [while] loop:
all of the conditions will be converted to true or false, so we don't need !==false in our conditions (this will not effect your script, i said that just to know ;) )
2- actually in this part ($data = fgetcsv($handle 1, ",")), $data will convert to an array and you cannot replace double quotations like...Leave a comment:
-
We know about that, he have problem with writing some columns of the main file in a new file...Leave a comment:
-
alright, i tried to test your script, but it doesn't work for me
if it works for you, i just added few lines to make sure your script will ignore the empty lines:
Code:<?php $row = 1; $handle1 = fopen("geotext_1a.csv", "r"); $handle2 = fopen("geo_sm_1a.csv", "w"); while (($data = fgetcsv($handle1, ",")) !== FALSE) { if(strlen($data)>5)
Leave a comment:
-
Ok, i downloaded your file and test it with the previous script that i wrote for you and it worked correctly, it seems that you have something wrong with writing columns in your new file,
i changed the script and added another function that works great with your CSV file (i have already test that)
Code:<?php function read_csv_file($file, $newfile) { $fp = fopen($file, "r");
Leave a comment:
-
it's possible, just upload the large file (CSV) and give me the link of uploaded file, i will make the code for youLeave a comment:
-
Fixed Code
Try this:
Code:<?php function read_csv_file($file) { $fp = fopen($file, "r"); $stream = fread($fp, filesize($file)); $stream = str_replace("\"","",$stream); $rows = explode("\n", $stream); $data = array(); for($i = 0; $i<=count($rows)-1; $i++) { $cells = explode(",",$rows[$i]);
Leave a comment:
-
resolve download limit problem
it's because php stops your script (your script will timeout).. to avoid it, copy following code in the top of your script:
set_time_limit( 99999999);...Leave a comment:
No activity results to display
Show More
Leave a comment: