Can someone helo me with this PHP code?

  • Thread starter Thread starter William R
  • Start date Start date
W

William R

Guest
This is the PHP code that takes a persons name, creates a sub folder in the upload directory with the name entered, puts a file there as well as emailing me, The code i have is

if ($_POST["folnam"] == "") echo "Please enter your name"; elseif ($_FILES["file"]["name"] == "") echo "Nothing to Upload"; else { mkdir($_POST["folnam"]);
move_uploaded_file($_FILES["file"]["tmp_name"], "upload/$_POST["folnam"]" . $_FILES["file"]["name"]); $to = "[email protected]"; $subject = "A file has been sent by $_POST["folnam"]"; $message = "Hello! I have sent you a file, it is $_FILES["file"]["name"]"; $from = $_POST["folnam"]; $headers = "From: $_POST["folnam"]"; mail($to,$subject,$message,$headers); }

the output on my page was 'Parse error: syntax error, unexpected '"', expecting T_STRING or T_VARIABLE or T_NUM_STRING'

U have tried everything I can think of, but can't seem to find the problem
 
Back
Top