Page 1 of 1

Where do I add my email address??? Please help!

Posted: Sat Jul 09, 2011 2:00 pm
by jjfletcher90

Code: Select all

 <?php
    header("Location:http://www.website.com/uploaded.html");
?>
 <?php
 $target = "upload/";
 $target = $target . basename( $_FILES['uploaded']['name']) ;
 $ok=1;

 //This is our size condition
 if ($uploaded_size > 350000)
 {
 echo "Your file is too large.<br>";
 $ok=0;
 }

 //This is our limit file type condition
 if ($uploaded_type =="text/php")
 {
 echo "No PHP files<br>";
 $ok=0;
 }

 //Here we check that $ok was not set to 0 by an error
 if ($ok==0)
 {
 Echo "Sorry your file was not uploaded";
 }

 //If everything is ok we try to upload it
 else
 {
 if(move_uploaded_file($_FILES['uploaded']['tmp_name'], $target))
   {
   echo "The file ". basename( $_FILES['uploadedfile']['name']). " has been
  uploaded";
   @mail($to, $subject, $msg, $headers);
  }
 else
 {
 echo "Sorry, there was a problem uploading your file.";
 }
 }

 ?>

Re: Where do I add my email address??? Please help!

Posted: Sat Jul 09, 2011 2:05 pm
by jjfletcher90
By the way.... This is the upload form!

Code: Select all


<form enctype="multipart/form-data" action="upload.php" method="POST">
 Please Upload the Desired Signature file<p>Please choose a file: <input name="uploaded" type="file" /><br />
 <input type="submit" value="Upload" />
 </p>
 </form>


Re: Where do I add my email address??? Please help!

Posted: Sat Jul 09, 2011 2:32 pm
by oscardog
And this is why you shouldn't just copy code straight from a tutorial. At least, it looks like it's from a tutorial and you've changed it. For a start, setting that header() at the top will mean nothing is ever done with the form, it will just send the user straight to uploaded.html.

Move the header() line to the line below @mail($to, $subject, $msg, $headers); and change the '$to' in that line (the mail line) to where you want the email to go. However, it hasn't set any other parameters such as subject / msg etc.

Re: Where do I add my email address??? Please help!

Posted: Sat Jul 09, 2011 2:43 pm
by jjfletcher90
Correct as you pointed out... I am new to this and cut and pasted what i could find to try and produce the results needed... tough to say the least if one does not know what they are doing... "Like Me"... Anyway ... I appreciate your feedback and will try to manipulate the code as suggested... Hope I have success... again thanks for the response! John

Re: Is this accurate??? Please help!

Posted: Sat Jul 09, 2011 2:54 pm
by jjfletcher90

Code: Select all


echo "The file ". basename( $_FILES['uploadedfile']['name']). " has been
   uploaded";
    @mail($name@myemailaddress.com, $subject, $msg, $headers);
   header("Location:http://www.exactusign.com/members/Members_Area/uploaded.html");
   }
  else
  {
  echo "Sorry, there was a problem uploading your file.";
  }
  }

 ?>
When I made this manipulation to the code I received the following error!

Code: Select all

Parse error: syntax error, unexpected '@' in D:\Hosting\3945010\html\ExactUSign\members\Members_Area\upload.php on line 34