goldy30
New Member
- Messages
- 60
- Reaction score
- 0
- Points
- 0
It's not something we've done yet, although we have done a bit of php. I put a basic sendmail.php but it doesnt stop users slapping the submit button which sends me a blank email.
I tried something like this but its giving me errors about '{' and other stuff.. I've changed it a few times but I'm not fully versed on php.
Any thoughts?
<?php
$first_name=$_REQUEST['first_name'];
$last_name=$_REQUEST['last_name'];
$email = $_REQUEST['email'] ;
$message = $_REQUEST['message'] ;
if (!isset($_REQUEST['email'])) {
header( "Location: http://www.housepainter.pcriot.com/contact.htm" ); // header is obviously a problem, yes??
}
elseif (empty($email) || empty($message)) {
header( "Location: http://www.example.com/contact_error.htm" ); //how do you redirect to a page?
}
else {
mail( "myname@example.com", "Contact Notification",
$message, "From: $email" );
}
?>
www.housepainter.pcriot.com
Thanks,
TAFE STUDENT
Edit:
it's obviously wrong but Im not sure?? I get this error:
Warning: Cannot modify header information - headers already sent by (output started at /home/goldy30/public_html/sendmail.php:8) in /home/goldy30/public_html/sendmail.php on line 29
I tried something like this but its giving me errors about '{' and other stuff.. I've changed it a few times but I'm not fully versed on php.
Any thoughts?
<?php
$first_name=$_REQUEST['first_name'];
$last_name=$_REQUEST['last_name'];
$email = $_REQUEST['email'] ;
$message = $_REQUEST['message'] ;
if (!isset($_REQUEST['email'])) {
header( "Location: http://www.housepainter.pcriot.com/contact.htm" ); // header is obviously a problem, yes??
}
elseif (empty($email) || empty($message)) {
header( "Location: http://www.example.com/contact_error.htm" ); //how do you redirect to a page?
}
else {
mail( "myname@example.com", "Contact Notification",
$message, "From: $email" );
}
?>
www.housepainter.pcriot.com
Thanks,
TAFE STUDENT
Edit:
it's obviously wrong but Im not sure?? I get this error:
Warning: Cannot modify header information - headers already sent by (output started at /home/goldy30/public_html/sendmail.php:8) in /home/goldy30/public_html/sendmail.php on line 29
Last edited: