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" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
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: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
> 
> 


-- 
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]

Reply via email to