Jump to content
xisto Community
Sign in to follow this  
Jesse

Process.php Help

Recommended Posts

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, <a

href=\"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 have
for 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 :P

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

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 <?php
I 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

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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×
×
  • Create New...

Important Information

Terms of Use | Privacy Policy | Guidelines | We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.