Re: Parse error: parse error in/test/put_file.php on line 14???

From: Date: Tue, 18 Dec 2001 09:46:06 +0000
Subject: Re: Parse error: parse error in/test/put_file.php on line 14???
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-78049@lists.php.net to get a copy of this message
The problem is here $pos = strrpos($file, "\"); must be $pos = strrpos($file, "\\"); Regards, Andrey Hristov IcyGEN Corporation http://www.icygen.com BALANCED SOLUTIONS ----- Original Message ----- From: "Alex Elderson" <alex@netflex.nl> To: <php-general@lists.php.net> Sent: Tuesday, December 18, 2001 11:26 AM Subject: [PHP] Parse error: parse error in/test/put_file.php on line 14??? > Hi, > > What do i wrong? I get this err: > > Parse error: parse error in /test/put_file.php on line 14 > > --------put_file.php begin--------- > <?php > if ($submit) { > include('include.php'); > $pos = strrpos($file, "\"); > if ($pos === FALSE) { > $pos = strrpos($file, "/"); > if ($pos === FALSE) { > $pos = 0; > } > } > $name = substr($file, $pos + 1); > $applicationn = substr($file, strrpos($file, ".")); > > $fd = fopen($file, "r") or die("can't open the file"); > $file_bin = fread($fd, filesize($file)); > fclose($fd); > $file_bin = mysql_escape_string($file_bin); > > $sql = "INSERT INTO files (id, name, description, file, application) > VALUES ('', '$name', '$description', '$file_bin', > '$application')"; > $result = mysql_query ($sql) or die('fout'); > } > ?> > --------put_file.php end--------- > > > --------include.php begin--------- > <?php > $conn = mysql_connect("localhost","user","password"); > > mysql_select_db("test", $conn); > ?> > --------include.php end--------- > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net > For additional commands, e-mail: php-general-help@lists.php.net > To contact the list administrators, e-mail: php-list-admin@lists.php.net > >

« previous php.general (#78049) next »