Looking at the code I have the disadvantage of knowing nothing about php which means I couldnt even figure out where to put my eMail address to get the info into my inbox.
I’m going back to the drawing board and taking a look at a tutorial in Head first php & My sql book see if i can get it. Seams a bit of a pain when all i want is for this form just to work…
Looking at the code I have the disadvantage of knowing nothing about php which means I couldnt even figure out where to put my eMail address to get the info into my inbox.
Ive never done php before & today I tried but failed to get a form to ping back data filled out on a form to my eMail . The form in question is the top url link and screen grab of the form.
I know I have to create a seperate php file and whilst at the mo this is empty. I cleared all previous efforts as they failed miserably I do at least understand it needs a php script behind the form but I’m out of my depth big time:-(
You want to create a script that receives the info from the form, and send an email? Googling gives you lots of tutorials that talk about just that. A good starting point, no?
Unless of course I misunderstood your question.
I get this error message: Warning: mail() [function.mail]: SMTP server response: 554 <hello@pause.co.uk>: Recipient address rejected: Relay access denied in E:\domains\p\pauserefreshment.co.uk\user\htdocs\report.php on line 29
php script:
<!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" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Aliens Abducted Me - Report an Abduction</title>
</head>
<body>
<h2>Aliens Abducted Me - Report an Abduction</h2>
<?php
$name = $_POST['firstname'] . ' ' . $_POST['lastname'];
$when_it_happened = $_POST['whenithappened'];
$how_long = $_POST['howlong'];
$how_many = $_POST['howmany'];
$alien_description = $_POST['aliendescription'];
$what_they_did = $_POST['whattheydid'];
$fang_spotted = $_POST['fangspotted'];
$email = $_POST['email'];
$other = $_POST['other'];
$to = 'hello@pause.co.uk';
$subject = 'Aliens Abducted Me - Abduction Report';
$msg = "$name was abducted $when_it_happened and was gone for $how_long.\
" .
"Number of aliens: $how_many\
" .
"Alien description: $alien_description\
" .
"What they did: $what_they_did\
" .
"Fang spotted: $fang_spotted\
" .
"Other comments: $other";
mail($to, $subject, $msg, 'From:' . $email);
echo 'Thanks for submitting the form.<br />';
echo 'You were abducted ' . $when_it_happened;
echo ' and were gone for ' . $how_long . '<br />';
echo 'Number of aliens: ' . $how_many . '<br />';
echo 'Describe them: ' . $alien_description . '<br />';
echo 'The aliens did this: ' . $what_they_did . '<br />';
echo 'Was Fang there? ' . $fang_spotted . '<br />';
echo 'Other comments: ' . $other . '<br />';
echo 'Your email address is ' . $email;
?>
</body>
</html>
At the mo i get this error message:
“Parse error: syntax error, unexpected T_IF in E:\domains\p\pauserefreshment.co.uk\user\htdocs\brochure.php on line 24”
I’ve corrected the php script to:
<?php
$configuration = array(
'email.to' => 'hello@pause.co.uk',
'email.from' => 'hello@pause.co.uk',
'email.subject' => 'A website enquiry!'
);
if('POST' === $_SERVER['REQUEST_METHOD']){
$message = sprintf(
" This is a test message:-
Name: %s %s
Email: %s
Thanks.
",
$_POST['name'],
$_POST['secondname'],
$_POST['email']
);
ini_set('sendmail_from', $configuration['email.from'])
if(mail($configuration['email.to'], $configuration['email.subject'], $message, sprintf("%s\\r\
", $configuration['email.from']))){ echo '<h1>Thankyou.</h1>'; exit;
}
}
?>
<h1>Sorry, an error occured.</h1>
I also called my hosters and they cant help Its hard to know for me to know where the problem is comming from. There are forms that allready work on the site so the original coders knew something I cant get my head around.
Well I’m not giving up yet but this is testing me big time :mad: