PDA

View Full Version : PHP Whack-out!



Hypertext
18-12-2006, 05:02 PM
PHP Needed pls check this id be very happy if u could validate it for me thx in advance




<?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. :)

tekni
18-12-2006, 05:03 PM
validate?

wth?

Hypertext
18-12-2006, 05:07 PM
it doesn't work.. could you tell me whats wrong with it.

Kymux
18-12-2006, 05:09 PM
Have you named anything in it?

tekni
18-12-2006, 05:09 PM
pretty crap coding if you ask me.

Edited by J1MI (Forum Moderator) - Please don't post pointlessly.

Hypertext
18-12-2006, 05:12 PM
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


<!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>

tekni
18-12-2006, 05:18 PM
there's never only 1 way of coding.

that's one of the frist things you shold learn - especially in php.

Hypertext
18-12-2006, 07:07 PM
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.

Wirlwind!
18-12-2006, 07:12 PM
: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.

omgDAN!
18-12-2006, 07:32 PM
"there is only 1 way of coding"

PMSL

Hypertext
18-12-2006, 07:58 PM
OK Only 1 way od coding a certain thing in a certain coded language? happy? sorry for my earlier blurt my god he annoyed me insulting all he wants but no suggestions, open to advice on where its gone wrong seems in order but no email

YouFail
18-12-2006, 08:54 PM
Still incorrect :)

Also if your pro web designers how come you don't know how to make a simple PHP contact form? As you were so rude to my friend Adam i'm not gonna help you :)

PappaLou
19-12-2006, 05:33 PM
"there is only 1 way of coding"

PMSL

There is only 1 way of coding..

writing out code with a keyboard :)

Want to hide these adverts? Register an account for free!