Justtechjobs.com Find a programming school near you






Online Campus Both


php-general | 2001122

Re: [PHP] Parse error: parse error in/test/put_file.php on line 14??? From: Andrey Hristov (ahristov <email protected>)
Date: 12/18/01

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 <email protected>>
To: <php-general <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: php-general-unsubscribe <email protected>
> For additional commands, e-mail: php-general-help <email protected>
> To contact the list administrators, e-mail: php-list-admin <email protected>
>
>

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: php-general-unsubscribe <email protected>
For additional commands, e-mail: php-general-help <email protected>
To contact the list administrators, e-mail: php-list-admin <email protected>