PHP 4.0 Bug #9727 Updated: Unable to use @ in URL passwords with fopen()

From: Date: Tue, 13 Mar 2001 21:54:48 +0000
Subject: PHP 4.0 Bug #9727 Updated: Unable to use @ in URL passwords with fopen()
Groups: php.dev 
Request: Send a blank email to php-dev+get-48848@lists.php.net to get a copy of this message
ID: 9727 Updated by: sniper Reported By: aaron.webb@corenetworks.com Old-Status: Open Status: Closed Bug Type: Filesystem function related Assigned To: Comments: There is one bug in your script: . . $server = "servername"; . . echo $filename = 'ftp://username:'.$pword."@$servername/$filename"; . . You haven't got $servername set but $server. Try changing that. Reopen if this wasn't the problem. --Jani Previous Comments: --------------------------------------------------------------------------- [2001-03-13 18:21:51] aaron.webb@corenetworks.com I'm running 4.0.4pl1 on redhat 6.1. I've tried (raw and regular) urlencoding my ftp password to use with fopen, but if there's a @ in it it says 'bad file descriptor'. I can open any file via ftp just fine, as long as there's no @ in the filename. The 'allow url fopen' (can't remember the exact name) is set to ON in my php.ini. Here's my script: <html> <body> <? $pword = 'stuff@stuff'; $server = "servername"; $filename = "filename"; $pword = urlencode($pword); echo $filename = 'ftp://username:' . $pword . "@$servername/$filename"; $fd = fopen ($filename, "r"); echo $contents = fread ($fd, 100); fclose ($fd); ?> </body> </html> --------------------------------------------------------------------------- ATTENTION! Do NOT reply to this email! To reply, use the web interface found at http://bugs.php.net/?id=9727&edit=2

« previous php.dev (#48848) next »