I’m trying to get photos to upload via an upload form to a photo folder on my host’s server but for some reason I keep getting the following error:
Parse error: syntax error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING in /home/rox/public_html/random.inc on line 7
Here is my code
[CODE]
<?php
$randomiser = rand(0000, 99999);
$remove_these = array(‘ ‘,’`’,'”‘,”’,’\’,’/’);
$newname = str_replace($remove_these,”,$_FILES[‘pix’][‘name’]);
$newname = $randomiser.’-‘.$newname;
$upload_path = “$_SERVER[‘DOCUMENT_ROOT’] . ‘/photos/’$newname”;
move_uploaded_file($_FILES[‘pix’][‘tmp_name’], $upload_path);
$randomiser = rand(0000, 99999);
$remove_these = array(‘ ‘,’`’,'”‘,”’,’\’,’/’);
$newname2 = str_replace($remove_these,”,$_FILES[‘pix2’][‘name’]);
$newname2 = $randomiser.’-‘.$newname1;
$upload_path = “$_SERVER[‘DOCUMENT_ROOT’] . ‘/photos/’$newname2″;
move_uploaded_file($_FILES[‘pix2’][‘tmp_name’], $upload_path);
$randomiser = rand(0000, 99999);
$remove_these = array(‘ ‘,’`’,'”‘,”’,’\’,’/’);
$newname3 = str_replace($remove_these,”,$_FILES[‘pix3’][‘name’]);
$newname3 = $randomiser.’-‘.$newname3;
$upload_path = “$_SERVER[‘DOCUMENT_ROOT’] . ‘/photos/’$newname3”;
move_uploaded_file($_FILES[‘pix3’][‘tmp_name’], $upload_path);
?>
I think there is something wrong with the $upload_path value but I can’t see where it is.
Can anyone help me? Thanks in advance