View Full Version : php question


gotfaith3
03-03-2003, 01:59 PM
okay if you know about php.. i need your help... go here (http://rohs.nl/php/addmail.phps) and i want to use that and make an email form... but what color text is the text im supposed to change? can someone explain it to me.. please??

alkaline39
03-03-2003, 03:01 PM
// your webpage
// your email

those are comments in orange, u want to change the code that the orange comments follow

$subject = "Mail from Domain.com"; // your webpage
$to = "user@domain.com"; // your email

i think that should work

gotfaith3
03-03-2003, 03:05 PM
okay.. i have that script at http://gotfaith3.coolfreepages.com/email.php but how come nothing else shows up on the page except for please fill on all three forms????

Ökii
03-03-2003, 04:01 PM
are you posting values for 'email', 'name' and 'message' to the page you listed - it should work if you do.

eg

<form action="http://gotfaith3.coolfreepages.com/email.php " method="post">
name: <input type="text" name="name" /><br />
email: <input type="text" name="email" /><br />
<textarea name="message"></textarea>
<br /><input type="submit" value="submit" />
</fprm>

gotfaith3
03-03-2003, 05:59 PM
this is the code that i'm using....

<?php
$email = $_POST["email"];
$headers = "From: " . $_POST["email"];
$host = gethostbyaddr($_SERVER["REMOTE_ADDR"]);
$ip = $_SERVER["REMOTE_ADDR"];
$message = $_POST["message"];
$name = $_POST["name"];
$subject = "gotfaith3.coolfreepages.com/email.php"; // your webpage
$time = date("d F Y") . " @ " . date("H:i");
$to = "gotfaith3@hotmail.com"; // your email
$message2 = "Email: " . $email . "\nHost: " . $host . "\nIP: " . $ip . "\nMessage: " . $message . "\nName: " . $name . "\nTime: " . $time;

if ($email && $message && $name) {
if (mail($to, $subject, $message2, $headers)) {
print("Your mail has been sent.");
}

else {
print("The server encountered an unexpected condition which prevented it from fulfilling the request.");
}
}

else {
print("Please fill out all three fields.");
}
?>

hope that helped

Ökii
03-04-2003, 10:00 AM
are you posting values for 'email', 'name' and 'message' to the code you listed - it should work if you do.

gotfaith3
03-04-2003, 02:23 PM
how wouldl i do that?

Ökii
03-04-2003, 08:28 PM
with a form - as per my previous reply. correct the slight mistakes though...

gotfaith3
03-04-2003, 09:04 PM
one other '?'... how would i get it to where when you press the send button or submit button , that it will email it to me but also bring them to a thank you type page.....????