-
PHP Whack-out!
PHP Needed pls check this id be very happy if u could validate it for me thx in advance
PHP Code:
<?php
// get posted data into local variables
$EmailFrom = "[email protected]";
$EmailTo = "[email protected]";
$Subject = "Quote Request";
$Name = Trim(stripslashes($_POST['Name']));
$Email = Trim(stripslashes($_POST['Email']));
$Details = Trim(stripslashes($_POST['Details']));
// validation
$validationOK=true;
if (!$validationOK) {
print "<meta http-equiv=\"refresh\" content=\"0;URL=error.htm\">";
exit;
}
// prepare email body text
$Body = "";
$Body .= "Name: ";
$Body .= $Name;
$Body .= "\n";
$Body .= "Email: ";
$Body .= $Email;
$Body .= "\n";
$Body .= "Details: ";
$Body .= $Details;
$Body .= "\n";
// send email
$success = mail($EmailTo, $Subject, $Body, "From: <$EmailFrom>");
// redirect to success page
if ($success){
print "<meta http-equiv=\"refresh\" content=\"0;URL=ok.htm\">";
}
else{
print "<meta http-equiv=\"refresh\" content=\"0;URL=error.htm\">";
}
?>
Thx in advance ;)
Thread Moved by J1MI (Forum Moderator) - From website designing, please post in the correct section next time. thanks. :)
-
-
it doesn't work.. could you tell me whats wrong with it.
-
Have you named anything in it?
-
pretty crap coding if you ask me.
Edited by J1MI (Forum Moderator) - Please don't post pointlessly.
-
well if it is pretty crappy coding i really dont get why, if you want coding to do something theres usually one way of doing it, thats my way, ok, pls could you help out if u need the htmlfile here it is
Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Pro web designs UK - Contact Form.</title>
<style type="text/css">
<!--
body,td,th {
font-family: Arial, Verdana;
}
body {
background-color: #333333;
}
.style1 {color: #FFFFFF}
-->
</style></head>
<body>
<form method="POST" action="contact.php">
<p><span class="style1">Name:</span><br>
<input type="text" name="Name">
<p><span class="style1">Email:</span><br>
<input type="text" name="Email">
<p><span class="style1">Details:</span><br>
<textarea name="Details"></textarea>
<p><input type="submit" name="submit" value="Submit">
<span class="style1">All fields are required </span>
</form>
</body>
</html>
-
there's never only 1 way of coding.
that's one of the frist things you shold learn - especially in php.
-
OF FOR GODS SAKE! *Text Removed* insulting it if you know better tell me where its wrong mr PHP ***** U!"
Edited by J1MI (Forum Moderator) - Please don't avoid the filter.
-
:o is there any need to Swear, also there is no need for the insults Come on :S
Edited by J1MI (Forum Moderator) - Please stay ontopic.
-
"there is only 1 way of coding"
PMSL