I am putting together a simple upload program where an
HTML form calls a php script passing a file which is
then used to upload. I am running this locally
currently, prior to rolling out to a test server.

My problem is this. The variable $filename I am
passing from the form to the php script is having the
path corrupted. In the php script if I echo
$filename_name the file name is being passed correctly
(test.txt) but when I echo the $filename variable it
contains a value of \\php2 when infact the correct
value should be c:\test.txt. 

I include below my sample code. If anyone has any
ideas I would be most grateful.

Thanks in advance,




<FORM form enctype="multipart/form-data" METHOD=POST
ACTION = "uploadrjb.php3" >
Upload file             : <INPUT TYPE="file" INPUT
Image Description       : <INPUT TYPE="text"
NAME="description" SIZE=40 align="left"><BR>
First Name              : <INPUT TYPE="text" NAME="firstname"
SIZE=30 align="left">  Last Name: <INPUT TYPE="text"
NAME="lastname" SIZE=30 align="left"><BR>
Location                : <SELECT NAME="location" > 
<OPTION VALUE ="01">Dagenham</OPTION>
<OPTION VALUE ="02">Romford</OPTION>
Age                     : <INPUT TYPE="text" NAME="age" SIZE=2
Email Address           : <INPUT TYPE="text" NAME="email"
SIZE=30 ALIGN="left"><BR>



//echo $userfile; <BR>

    echo "File=" . "$userfile"; 
  echo "File=" . $userfile_name; 

//echo "Description=" . $description; 
//echo "Age= " . $age; 
//echo "First Name = " . $firstname; 
//echo "Last Name = " . $lastname;
//echo "Location = ". $location; 
//echo "Email = ". $email; 

if ( isset($userfile)  ) {
        if ( copy("c:\\" . "$userfile_name",
"c:\\bollocks.txt") ) {
                echo("<B>File Successfully copied</B>");
        } else {
                echo("<B>Error: Failed to copy file...<B>");

Do You Yahoo!?
NEW from Yahoo! GeoCities - quick and easy web site hosting, just $8.95/month.

PHP General Mailing List (
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