Jump to content


Photo

Help With Chap.1


  • Please log in to reply
8 replies to this topic

#1 adamburda23

adamburda23

    New Member

  • Members
  • Pip
  • 1 posts

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?

#2 drewdin

drewdin

    Super Veteran Member

  • Members
  • PipPipPipPipPipPipPipPipPipPipPip
  • 608 posts
  • 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?

#3 thomasmh

thomasmh

    New Member

  • Members
  • Pip
  • 6 posts

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.

#4 thomasmh

thomasmh

    New Member

  • Members
  • Pip
  • 6 posts

Posted 19 July 2012 - 04:11 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.



#5 thomasmh

thomasmh

    New Member

  • Members
  • Pip
  • 6 posts

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...nsitional.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>

#6 drewdin

drewdin

    Super Veteran Member

  • Members
  • PipPipPipPipPipPipPipPipPipPipPip
  • 608 posts
  • 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?

#7 thomasmh

thomasmh

    New Member

  • Members
  • Pip
  • 6 posts

Posted 10 October 2012 - 09:43 PM

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 Thumbnails

  • MAMP.png
  • filefolders.png
  • File.png


#8 thomasmh

thomasmh

    New Member

  • Members
  • Pip
  • 6 posts

Posted 11 October 2012 - 03:56 PM

This is what I am using.



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

#9 thomasmh

thomasmh

    New Member

  • Members
  • Pip
  • 6 posts

Posted 11 October 2012 - 04:15 PM

Are you using URL:
http://localhost/ali...ial/report.html ?



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 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users