Jump to content


Photo

parse error


  • Please log in to reply
4 replies to this topic

#1 techrahul87

techrahul87

    Member

  • Members
  • PipPip
  • 16 posts

Posted 08 July 2011 - 05:14 AM

hello
      i am uploading a file in a folder. the code is working fine on localhost.
      but oon server it is generating error.
      Parse error: syntax error, unexpected '}' in /home/content/v/i/b/vibescom/html/temp_dir/upload.php on line 1
here is the code
<html>
<head></head>
<body>
<?php
if ($_SERVER['REQUEST_METHOD'] == "POST")
{
	$target_path = "uploads/";

	$target_path = $target_path . basename( $_FILES['uploadedfile']['name']); 

if(move_uploaded_file($_FILES['uploadedfile']['tmp_name'], $target_path))
    {
    echo "The file ".  basename( $_FILES['uploadedfile']['name']). 
    " has been uploaded";
	} 
else{
    echo "There was an error uploading the file, please try again!";
    }
}
else
{
?>
<form enctype="multipart/form-data" action="upload.php" method="POST">
<input type="hidden" name="MAX_FILE_SIZE" value="100000" />
Choose a file to upload: <input name="uploadedfile" type="file" /><br />
<input type="submit" value="Upload File" />
</form>
<?php
}
?>
</body>
</html>

please help me out


#2 gristoi

gristoi

    Advanced Member

  • Members
  • PipPipPip
  • 835 posts

Posted 08 July 2011 - 07:11 AM

this works fine on my localhost. Is this upload.php that you have posted?
To err is human... to really foul up requires the root password

#3 techrahul87

techrahul87

    Member

  • Members
  • PipPip
  • 16 posts

Posted 08 July 2011 - 07:38 AM

yes it is upload.php..try it on server......i was getting error.........

#4 gristoi

gristoi

    Advanced Member

  • Members
  • PipPipPip
  • 835 posts

Posted 08 July 2011 - 07:41 AM

my localhost is a full apache linux server
To err is human... to really foul up requires the root password

#5 techrahul87

techrahul87

    Member

  • Members
  • PipPip
  • 16 posts

Posted 08 July 2011 - 07:43 AM

;)




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

Cheap Linux VPS from $5
SSD Storage, 30 day Guarantee
1 TB of BW, 100% Network Uptime

AlphaBit.com