O'Reilly Forums: Help With Chap.1 - O'Reilly Forums

Jump to content

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

Help With Chap.1 Email

#1 User is offline   adamburda23 

  • New Member
  • Pip
  • Group: Members
  • Posts: 1
  • Joined: 10-April 12

Posted 10 April 2012 - 07:00 PM

Ok im am new to PHP. But I do know HTML, CSS, and Java script.

I have every thing set up for PHP, Apache, MySQL. I started chap.1, The email part im using is live mail. When i click on the submit button the email pops up but nothing in the body and or subject. I get the eamil sent to a email address to were I want it to go and still nothing in the email when i open it.

Any ideas?
0

#2 User is offline   drewdin 

  • Super Veteran Member
  • PipPipPipPipPipPipPipPipPipPipPip
  • Group: Members
  • Posts: 608
  • Joined: 11-February 10
  • Gender:Male
  • Location:Boston

Posted 11 April 2012 - 08:04 PM

can't tell without seeing your code, also are you using damp/mamp on your local machine to send the emails?
0

#3 User is offline   thomasmh 

  • New Member
  • Pip
  • Group: Members
  • Posts: 6
  • Joined: 17-July 12

Posted 19 July 2012 - 04:00 PM

I am also having the same problem with Chapter 1. I put all the docs into htdocs,( fang.jpg, report.html, report.html, style.css) opened report.html, filled in the form, hit submit and I get the report.php page. I changed my ports on MAMP according to The Missing Manual, Dreamweaver CS 4. Apache Port 80 and Mysql Port 3306. I feel like I am missing a point. I even tried it with the final examples.
0

#4 User is offline   thomasmh 

  • New Member
  • Pip
  • Group: Members
  • Posts: 6
  • Joined: 17-July 12

Posted 19 July 2012 - 04:11 PM

View Postthomasmh, on 19 July 2012 - 04:00 PM, said:

I am also having the same problem with Chapter 1. I put all the docs into htdocs,( fang.jpg, report.html, report.html, style.css) opened report.html, filled in the form, hit submit and I get the report.php page. I changed my ports on MAMP according to The Missing Manual, Dreamweaver CS 4. Apache Port 80 and Mysql Port 3306. I feel like I am missing a point. I even tried it with the final examples.

0

#5 User is offline   thomasmh 

  • New Member
  • Pip
  • Group: Members
  • Posts: 6
  • Joined: 17-July 12

Posted 24 September 2012 - 09:31 PM

Replying to why I can't get anything but a ci0de page when I submit a form.

This is the code I get:

<!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><html>

<?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 = 'tmharrigan@me.com';
$subject = 'Aliens Abducted Me - Abduction Report';
$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 />';
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>
0

#6 User is offline   drewdin 

  • Super Veteran Member
  • PipPipPipPipPipPipPipPipPipPipPip
  • Group: Members
  • Posts: 608
  • Joined: 11-February 10
  • Gender:Male
  • Location:Boston

Posted 25 September 2012 - 05:11 AM

You have a MAC with MAMP installed, and your files are located in the htdocs folder? Did you make sure and start MAMP? can you send some screen shots so its easier to see the MAMP start page along with your file folder?
0

#7 User is offline   thomasmh 

  • New Member
  • Pip
  • Group: Members
  • Posts: 6
  • Joined: 17-July 12

Posted 10 October 2012 - 09:43 PM

View Postdrewdin, on 25 September 2012 - 05:11 AM, said:

You have a MAC with MAMP installed, and your files are located in the htdocs folder? Did you make sure and start MAMP? can you send some screen shots so its easier to see the MAMP start page along with your file folder?


Here is the file, file folder and mamp page.

Thomas

Attached thumbnail(s)

  • Attached Image: MAMP.png
  • Attached Image: filefolders.png
  • Attached Image: File.png

0

#8 User is offline   thomasmh 

  • New Member
  • Pip
  • Group: Members
  • Posts: 6
  • Joined: 17-July 12

Posted 11 October 2012 - 03:56 PM

This is what I am using.



file:///Applications/MAMP/htdocs/initial/aliens/report.html
0

#9 User is offline   thomasmh 

  • New Member
  • Pip
  • Group: Members
  • Posts: 6
  • Joined: 17-July 12

Posted 11 October 2012 - 04:15 PM

View Postlemuel, on 11 October 2012 - 09:40 AM, said:




In a nut shell, this is what I did.

My MAMP on a Mac is working. Instead of opening a browser and loading the report.html from applications/MAMP/htdocs/initial etc. I just typed "local" in my browser, saw the index, opened initial/Aliens/report.html. Typed in the answers, hit the Report Abduction button and bingo, I got a replay page and an email. On to more problems.

Please post this if this helps anyone else.
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