O'Reilly Forums: Chapter 1 - Radio Selection Not Showing Up In Report.php - O'Reilly Forums

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Chapter 1 - Radio Selection Not Showing Up In Report.php Generated HTML page not showing radio field result

#1 User is offline   gvetri 

  • New Member
  • Pip
  • Group: Members
  • Posts: 2
  • Joined: 13-March 14

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"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html lang="en" xml:lang="en" xmlns="http://www.w3.org/1999/xhtml">
<head>
<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 = 'hf.php.mysql@gmail.com';
$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.'.';
?>
</body>
</html>

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.

Regards,

Vetrivel

Attached thumbnail(s)

  • Attached Image: Aliens abducted me mail.JPG
  • Attached Image: Ch 1 - results page.JPG

0

#2 User is offline   gvetri 

  • New Member
  • Pip
  • Group: Members
  • Posts: 2
  • Joined: 13-March 14

Posted 20 March 2014 - 12:44 AM

Dear Members,

Thanks for all who have viewed.

I got the lines rewritten for the "echo" section and it worked fine.

Thank you once again.

Regards,

Vetrivel
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users