[PHP] Reading from file on local disk to server

2003-03-20 Thread Jan Meiring
Hi everyone

 This is what I want to do:

 I have a file on each workstation that gets created each time the pc is
 rebooted - the file save the pc configuration plus the current user logged
 onto the machine, I want to read from that file variables so that I can
save
 it to my mySQL database and run queries on the data. - I have no problem
 reading from a file if it is on the web server, but am experiencing
problems
 reading from the file on the remote client pc. - any suggestions?

 This is what I can do:

 Read from file on web server, set it to variables and write it to a mySQL
 database.






-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] reading from file

2001-07-25 Thread Stefan Kostopoulos


I am using the script include below to read the content
of a file and output it.

When I load this script with the adress of a plain html 
file it outputs everything like expected, except there are 
some extra characters spread over the file. They come in little
string like '40d' or '1000' and appear on positions
where there is 'nothing' in the original source file.

Any idea what could cause that behavior?

Stefan

?

$myServer = 'xxx.xxx.xxx.xx';

$document = 'index.shtml';

$fp=fsockopen($myServer,80,$errno,$errstr,30);

$request = GET $document HTTP/1.1\r\nAuthorization: Basic ;

$request .= base64_encode(xx:xx) . \r\n; 

$request .= Host: $myServer\r\n\r\n;

if(!$fp) {

echo $errstr ($errno)br\n;

} else {

fputs($fp,$request); 

while(!feof($fp)) {

$line=fgets($fp,4096);  
echo $line;

}

fclose($fp);


}

?

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]