funkyspyspy
12-21-2009, 10:34 AM
PLS!
My Code For Contact Is
<?php
if(isset($_POST['contact']))
//Uses the isset function to determine if the forms been posted or not.
{
$name = $_POST['name'];
$email = $_POST['email'];
$subj = $_POST['subj'];
$msg = $_POST['msg'];
$ip = $_SERVER['REMOTE_ADDR'];
//Creates variables for the post data and the users ip address.
if(!$name || !$email || !$msg)
//Checks for blank fields.
{
die("Error! Some fields were left blank! Please go back.");
//Alert the user. and kill the script.
}
else
//There's no blank fields so we continue..
{
$mail = "YOUREMAILHERE!";
//Change to youe email address..
$subject = "Contact from $name ($subj)";
//The subject of the email..
$messg = "
Name: $name
Email Address: $email
IP Address: $ip\n
Message:
$msg";
//The email message..
mail("$mail", $subject, $messg);
//Uses the mail function to send the email.
echo("Thank you message here..");
//The thank you message.
}
}
else
//The form hasn't been submitted..
{
echo("<p align=\"center\"><strong>Contact us..</strong></p>
<p>Use the form below to submit your queries directly to our inbox.</p>
<p><form method=\"post\">
<table width=\"600\" cellspacing=\"2\" cellpadding=\"0\">
<tr><td width=\"150\">Your Name:</td>
<td width=\"450\"><input type=\"text\" name=\"name\" size=\"30\" /></td></tr>
<tr><td width=\"150\">Email Address:</td>
<td width=\"450\"><input type=\"text\" name=\"email\" size=\"30\" /></td></tr>
<tr><td width=\"150\">Subject:</td>
<td width=\"450\"><select name=\"subj\">
<option>Option 1..</option>
<option>Option 2..</option>
<option>Option 3..</option></select></td></tr>
<tr><td width=\"150\">Your Message:</td>
<td width=\"450\"><textarea name=\"msg\" cols=\"50\" rows=\"7\"></textarea></td></tr>
<tr><td colspan=\"2\" align=\"center\"><input type=\"submit\" name=\"contact\" value=\"Contact Us\" /></td></tr>
</table></form></p>") //The form..
}
?>
But Ended Up
On My Source
says:
<?php
if(isset($_POST['contact']))
//Uses the isset function to determine if the forms been posted or not.
{
$name = $_POST['name'];
$email = $_POST['email'];
$subj = $_POST['subj'];
$msg = $_POST['msg'];
$ip = $_SERVER['REMOTE_ADDR'];
//Creates variables for the post data and the users ip address.
if(!$name || !$email || !$msg)
//Checks for blank fields.
{
die("Error! Some fields were left blank! Please go back.");
//Alert the user. and kill the script.
}
else
//There's no blank fields so we continue..
{
$mail = "YOUREMAILHERE!";
//Change to youe email address..
$subject = "Contact from $name ($subj)";
//The subject of the email..
$messg = "
Name: $name
Email Address: $email
IP Address: $ip\n
Message:
$msg";
//The email message..
mail("$mail", $subject, $messg);
//Uses the mail function to send the email.
echo("Thank you message here..");
//The thank you message.
}
}
else
//The form hasn't been submitted..
{
echo("<p align=\"center\">
<strong>Contact us..</strong></p>
<p>Use the form below to submit your queries directly to our inbox.</p>
<p><form method=\"post\">
<table width=\"600\" cellspacing=\"2\" cellpadding=\"0\">
<tr><td width=\"150\">Your Name:</td>
<td width=\"450\"><input type=\"text\" name=\"name\" size=\"30\" /></td></tr>
<tr><td width=\"150\">Email Address:</td>
<td width=\"450\"><input type=\"text\" name=\"email\" size=\"30\" /></td></tr>
<tr><td width=\"150\">Subject:</td>
<td width=\"450\"><select name=\"subj\">
<option>Option 1..</option>
<option>Option 2..</option>
<option>Option 3..</option></select></td></tr>
<tr><td width=\"150\">Your Message:</td>
<td width=\"450\"><textarea name=\"msg\" cols=\"50\" rows=\"7\"></textarea></td></tr>
<tr><td colspan=\"2\" align=\"center\"><input type=\"submit\" name=\"contact\" value=\"Contact Us\" /></td></tr>
</table></form></p>") //The form..
}
?>
PLS HELP ME!
IT Ended AT THE WRONG PLACE
My Code For Contact Is
<?php
if(isset($_POST['contact']))
//Uses the isset function to determine if the forms been posted or not.
{
$name = $_POST['name'];
$email = $_POST['email'];
$subj = $_POST['subj'];
$msg = $_POST['msg'];
$ip = $_SERVER['REMOTE_ADDR'];
//Creates variables for the post data and the users ip address.
if(!$name || !$email || !$msg)
//Checks for blank fields.
{
die("Error! Some fields were left blank! Please go back.");
//Alert the user. and kill the script.
}
else
//There's no blank fields so we continue..
{
$mail = "YOUREMAILHERE!";
//Change to youe email address..
$subject = "Contact from $name ($subj)";
//The subject of the email..
$messg = "
Name: $name
Email Address: $email
IP Address: $ip\n
Message:
$msg";
//The email message..
mail("$mail", $subject, $messg);
//Uses the mail function to send the email.
echo("Thank you message here..");
//The thank you message.
}
}
else
//The form hasn't been submitted..
{
echo("<p align=\"center\"><strong>Contact us..</strong></p>
<p>Use the form below to submit your queries directly to our inbox.</p>
<p><form method=\"post\">
<table width=\"600\" cellspacing=\"2\" cellpadding=\"0\">
<tr><td width=\"150\">Your Name:</td>
<td width=\"450\"><input type=\"text\" name=\"name\" size=\"30\" /></td></tr>
<tr><td width=\"150\">Email Address:</td>
<td width=\"450\"><input type=\"text\" name=\"email\" size=\"30\" /></td></tr>
<tr><td width=\"150\">Subject:</td>
<td width=\"450\"><select name=\"subj\">
<option>Option 1..</option>
<option>Option 2..</option>
<option>Option 3..</option></select></td></tr>
<tr><td width=\"150\">Your Message:</td>
<td width=\"450\"><textarea name=\"msg\" cols=\"50\" rows=\"7\"></textarea></td></tr>
<tr><td colspan=\"2\" align=\"center\"><input type=\"submit\" name=\"contact\" value=\"Contact Us\" /></td></tr>
</table></form></p>") //The form..
}
?>
But Ended Up
On My Source
says:
<?php
if(isset($_POST['contact']))
//Uses the isset function to determine if the forms been posted or not.
{
$name = $_POST['name'];
$email = $_POST['email'];
$subj = $_POST['subj'];
$msg = $_POST['msg'];
$ip = $_SERVER['REMOTE_ADDR'];
//Creates variables for the post data and the users ip address.
if(!$name || !$email || !$msg)
//Checks for blank fields.
{
die("Error! Some fields were left blank! Please go back.");
//Alert the user. and kill the script.
}
else
//There's no blank fields so we continue..
{
$mail = "YOUREMAILHERE!";
//Change to youe email address..
$subject = "Contact from $name ($subj)";
//The subject of the email..
$messg = "
Name: $name
Email Address: $email
IP Address: $ip\n
Message:
$msg";
//The email message..
mail("$mail", $subject, $messg);
//Uses the mail function to send the email.
echo("Thank you message here..");
//The thank you message.
}
}
else
//The form hasn't been submitted..
{
echo("<p align=\"center\">
<strong>Contact us..</strong></p>
<p>Use the form below to submit your queries directly to our inbox.</p>
<p><form method=\"post\">
<table width=\"600\" cellspacing=\"2\" cellpadding=\"0\">
<tr><td width=\"150\">Your Name:</td>
<td width=\"450\"><input type=\"text\" name=\"name\" size=\"30\" /></td></tr>
<tr><td width=\"150\">Email Address:</td>
<td width=\"450\"><input type=\"text\" name=\"email\" size=\"30\" /></td></tr>
<tr><td width=\"150\">Subject:</td>
<td width=\"450\"><select name=\"subj\">
<option>Option 1..</option>
<option>Option 2..</option>
<option>Option 3..</option></select></td></tr>
<tr><td width=\"150\">Your Message:</td>
<td width=\"450\"><textarea name=\"msg\" cols=\"50\" rows=\"7\"></textarea></td></tr>
<tr><td colspan=\"2\" align=\"center\"><input type=\"submit\" name=\"contact\" value=\"Contact Us\" /></td></tr>
</table></form></p>") //The form..
}
?>
PLS HELP ME!
IT Ended AT THE WRONG PLACE