0

i am reading file and getting content , on localhost it is working and displaying result.

but after uploading on server , not displaying or echo relevant content of file?

any help appre

thnx

$tcnt = 0;
$file = fopen("/home/uploads/date/".$list."_".$Type.".txt", "r") or exit("Unable to open file!");
				$file_rl = $file;
				
			while(!feof($file)) {
				$line=fgets($file);
                                
					if($line!='') {
                                            
						$lineq=explode("|",$line);
                                                
                                           
		
						if($tcnt==0){
								$head=$lineq;
								
								foreach($lineq as $fields){
							         //echo $fields.",  ";
								echo "<pre>";
								print_r($fields);
								}
						}

					
						else{
                                                           // insertion code goes here


						  }
4
Contributors
4
Replies
6
Views
6 Years
Discussion Span
Last Post by almostbob
0

/home/uploads/date/ exist on server?

fopen("/home/users/web/b1765/moo.somthing/ethom/uploads/data/".$listPage."_".$propType.".txt", "r") or exit("Unable to open file!");

acctu i tested this there is no problem here and getting file resource id.

0
$tcnt = 0;
$file = fopen("/home/uploads/date/".$list."_".$Type.".txt", "r") or exit("Unable to open file!");
$file_rl = $file;
while(!feof($file)) {
$lineq = fgetcsv($file,, "|"); 
if($tcnt==0){ $head=$lineq;
foreach($lineq as $fields){ //echo $fields.",  ";
echo "<pre>";
print_r($fields);
}
}
else{ // insertion code goes here
}

ignore this, was experimentig with the code and clicked post

Edited by almostbob: oops,,

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.