Sam
17-09-2005, 12:23 PM
Simple Code For A Contact Form :P I Can Make 100's Of other things too lmao
Simple copy n Paste this code into the content box on your site, Replacing the [email protected] with the email you want the form to be sent to :P
<?php
//Support for this script found at http://www.habbo-twice.co.uk/ at the forums area.
//Variables - Your e-mail address (keep this file name : contact.php)
$your_email = "[email protected]";
//Show Mail Form
function showForm() {
echo "<html><head>\n"
."<title>Contact Us</title>\n"
."</head><body>\n"
."<font face='arial' size='2'>\n"
."<h1>Contact Us</h1>\n"
."<form method='post' action='contact.php?action=sendEmail'>\n"
."<table width='100%' border='0' cellspacing='0' cellpadding='4'>\n"
."<tr>\n"
."<td width='25%'><font face='arial' size='2'>Your Name:</font></td>\n"
."<td width='75%'><input type='text' name='name' size='40'></td>\n"
."</tr><tr>\n"
."<td width='25%'><font face='arial' size='2'>Your Email:</font></td>\n"
."<td width='75%'><input type='text' name='email' size='40'></td>\n"
."</tr><tr>\n"
."<td width='25%'><font face='arial' size='2'>Subject:</font></td>\n"
."<td width='75%'><input type='text' name='subject' size='40'></td>\n"
."</tr><tr>\n"
."<td width='25%'><font face='arial' size='2'>Message:</font></td>\n"
."<td width='75%'><textarea name='message' rows='10' cols='35'></textarea></td>\n"
."</tr></table>\n"
."<input type='submit' value='Send'>\n"
."</form></body></html>\n";
}
//Send Email
function sendEmail() {
global $your_email,$name,$email,$subject,$message;
if ( !$name | !$email | !$subject | !$message ) {
header ("Location: contact.php");
}
else {
$email2 = "$email ($name)";
mail( $your_email, $subject, $message, "From: $email2");
echo "<html><head>\n"
."<title>Email Sent!</title>\n"
."</head><body>\n"
."<font face='arial' size='2'>\n"
."<h1>Email Sent!</h1>\n"
."Your Email has been sent with success!\n"
."</font></body></html>\n";
}
}
//Switch Statement
Switch ( $action ) {
Case 'sendEmail':
sendEmail();
Break;
Default:
showForm();
}
?>
Simple copy n Paste this code into the content box on your site, Replacing the [email protected] with the email you want the form to be sent to :P
<?php
//Support for this script found at http://www.habbo-twice.co.uk/ at the forums area.
//Variables - Your e-mail address (keep this file name : contact.php)
$your_email = "[email protected]";
//Show Mail Form
function showForm() {
echo "<html><head>\n"
."<title>Contact Us</title>\n"
."</head><body>\n"
."<font face='arial' size='2'>\n"
."<h1>Contact Us</h1>\n"
."<form method='post' action='contact.php?action=sendEmail'>\n"
."<table width='100%' border='0' cellspacing='0' cellpadding='4'>\n"
."<tr>\n"
."<td width='25%'><font face='arial' size='2'>Your Name:</font></td>\n"
."<td width='75%'><input type='text' name='name' size='40'></td>\n"
."</tr><tr>\n"
."<td width='25%'><font face='arial' size='2'>Your Email:</font></td>\n"
."<td width='75%'><input type='text' name='email' size='40'></td>\n"
."</tr><tr>\n"
."<td width='25%'><font face='arial' size='2'>Subject:</font></td>\n"
."<td width='75%'><input type='text' name='subject' size='40'></td>\n"
."</tr><tr>\n"
."<td width='25%'><font face='arial' size='2'>Message:</font></td>\n"
."<td width='75%'><textarea name='message' rows='10' cols='35'></textarea></td>\n"
."</tr></table>\n"
."<input type='submit' value='Send'>\n"
."</form></body></html>\n";
}
//Send Email
function sendEmail() {
global $your_email,$name,$email,$subject,$message;
if ( !$name | !$email | !$subject | !$message ) {
header ("Location: contact.php");
}
else {
$email2 = "$email ($name)";
mail( $your_email, $subject, $message, "From: $email2");
echo "<html><head>\n"
."<title>Email Sent!</title>\n"
."</head><body>\n"
."<font face='arial' size='2'>\n"
."<h1>Email Sent!</h1>\n"
."Your Email has been sent with success!\n"
."</font></body></html>\n";
}
}
//Switch Statement
Switch ( $action ) {
Case 'sendEmail':
sendEmail();
Break;
Default:
showForm();
}
?>