Jesse 0 Report post Posted November 27, 2005 I have the following code as: "process.php" it is to send a FeedBack / Support Form from my website. <?php// The error message if there are one or more fields not filled in$error = "There are some fields not filled in, <ahref=\"http://forums.xisto.com/no_longer_exists/ here to go back</a>";// Let's check if all fields are filled in!if($sender_name == "" || $sender_email == "" || $message == ""){// Lets echo that error!echo $error;}/*if after all everything is filled in correct, lets start doing the mailscript...Edit the variable's below to make them fit your needs*/else{$yourwebsite = "http://forums.xisto.com/no_longer_exists/;; // Your website$recipientname = "ZN Support"; // Whats your name ?!$subject="Support Form"; // The subject of the mail thats being sended$recipient="support@zaccynetwork.com"; // the recipient/*The headers for the e-mail, no need to change it unless you know what you're doing*/$header = "From: $nickname <$email>\r\n";$header .= "MIME-Version: 1.0\r\n";$header .= "Content-Type: text/html; charset=iso-8859-1\r\n";$header .= "X-Priority: 3\r\n";$header .= "X-MSMail-Priority: Normal\r\n";$header .= "X-Mailer: PHP / ".phpversion()."\r\n";/*You can change the text below to whatever you wish to havefor the way the mail is gonne be outputted, you can use HTML!*/$content= "Dear " . $recipientname . "," . $sender_name . " has sended you an e-mail from " . $yourwebsite . ".<br /><b>Message:</b>" . $message . "<hr noshade=\"true\" size=\"1\" color=\"#000000\" />You can contact " . $sender_name . " back at " . $sender_email . ".";// Lets send the e-mail by using the mail() function, no need to change below...this // can be edited above!mail($recipient, $subject, $content, $header);// Message the user will see if the e-mail is succesfully sended echo "Thanks! Your comments has been sended succesfully, " . $sender_name . ".";}?> However, when ever anyone trys to send it it is always telling them they have inputted the wrong information and sends them back.Any ideas on what is wrong with this script. Thanx Share this post Link to post Share on other sites
rvalkass 5 Report post Posted November 27, 2005 Nowhere do you actually get the information from the form, as far as I can see. The variables checked in the first if statement are all empty, as nowhere above that do you put anything in them.Try putting this at the top of your script, in the line below <?phpI am presuming the fields in the form have the names of the variables, and that you have set the method to POST: $sender_name = $_POST['sender_name'];$sender_email = $_POST['sender_email'];$message = $_POST['message']; It should work now. Share this post Link to post Share on other sites
cragllo 0 Report post Posted November 27, 2005 I think global vars is on? So you dont realy need to assign the variables, but it is good practice, This may well be your problem as i dont know if its still on. Share this post Link to post Share on other sites
xJedix 0 Report post Posted November 28, 2005 I have had many issues with this type of problem before. Sometimes the global variables will work but sometimes they won't so it is best to do what rvalkass said and assign and get the variables from the form in the process.php file.When I was working with login scripts, I went from one host to another. The first host had global vars on and the one I went to didn't so I had to mod everything to get it to work again.xJedix Share this post Link to post Share on other sites