form upload curious error
Posted: Fri May 23, 2003 8:11 am
Hello,
I have a problem.
I am unable to send a file using the 'file' input field of an html form <input name="thefile" type="file"> .
Error received:
Parse error: parse error, unexpected '<' in /home/.sites/137/site468/web/receiver.php3 on line 27
n.b.
I believe I have all the correct permissions set up to write/recieve the data to a php page ( i.e. the chmod settings ) as I was previosuly getting 405 errors and so moved the file that receives the form to a different directory.
form page - test1.php
..................................
<form method="post" action="page.php" enctype="multipart/form-data">
<input name="thefile" type="file"><input type="submit" value="Upload File">
</form>
relevent code on page.php
..........................................
<?php include 'receiver.php3'; ?>
page that receives form - receiver.php3
...............................................................
<?
$uploadPath = "/pstore/".$file_name;
copy ($thefile, $uploadPath);
echo "Your file has been uploaded. Details of the file is listed below:";
echo "$Date";
echo "$Title";
?>
As you can see from the receiver.php3 page there is no line 27, so where has the parse error come from?
I cannot even see that adding the details of the file sent in the form would add enough lines for there to be a line 27.
As you can tell I'm a newbie to php, but I have been stuggling for days - literally - with this.
Please help me!
Cheers
I have a problem.
I am unable to send a file using the 'file' input field of an html form <input name="thefile" type="file"> .
Error received:
Parse error: parse error, unexpected '<' in /home/.sites/137/site468/web/receiver.php3 on line 27
n.b.
I believe I have all the correct permissions set up to write/recieve the data to a php page ( i.e. the chmod settings ) as I was previosuly getting 405 errors and so moved the file that receives the form to a different directory.
form page - test1.php
..................................
<form method="post" action="page.php" enctype="multipart/form-data">
<input name="thefile" type="file"><input type="submit" value="Upload File">
</form>
relevent code on page.php
..........................................
<?php include 'receiver.php3'; ?>
page that receives form - receiver.php3
...............................................................
<?
$uploadPath = "/pstore/".$file_name;
copy ($thefile, $uploadPath);
echo "Your file has been uploaded. Details of the file is listed below:";
echo "$Date";
echo "$Title";
?>
As you can see from the receiver.php3 page there is no line 27, so where has the parse error come from?
I cannot even see that adding the details of the file sent in the form would add enough lines for there to be a line 27.
As you can tell I'm a newbie to php, but I have been stuggling for days - literally - with this.
Please help me!
Cheers