Jump to content
Chapter 1 - Radio Selection Not Showing Up In Report.php
1 reply to this topic
Posted 13 March 2014 - 09:04 AM
Dear Fellow Members, Greetings!
I am very new to PHP. I have a problem in "report.php" page generated by the Chapter 1 exercise (It's Alive - add life to your static pages).
The page not shows "Was Fang there?" line with the radio selection as expected in browser (latest Chrome), but it shows correctly in the email (please find the snaps attached):
Following is the code of my report.php:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
<html lang="en" xml:lang="en" xmlns="http://www.w3.org/1999/xhtml">
<title>Aliens Abducted Me - Report an Abduction</title>
<h2>Aliens Abducted Me - Report an Abduction</h2>
$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 = 'firstname.lastname@example.org';
$subject = 'Aliens Abducted Me - Report an Abduction';
$msg = "$name was abducted $when_it_happened and was gone for $how_long. \n" .
"Number of aliens: $how_many\n" .
"Alien Description: $alien_description\n" .
"What they did: $what_they_did\n" .
"Fang spotted: $fang_spotted\n" .
"Other comments: $other";
mail($to, $subject, $msg, 'From:'.$email);
echo 'Thanks for submitting the form.<br /><br />';
echo 'You were abducted '.$when_it_happened.' 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.'.';
Kindly advice on what went wrong and how to rectify this error.
I have hosting account with GoDaddy.com and using PHP ver 5.5.
Thanks in advance.
Posted 20 March 2014 - 12:44 AM
Thanks for all who have viewed.
I got the lines rewritten for the "echo" section and it worked fine.
Thank you once again.
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users