Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trialCRYSTAL MORRIS
Courses Plus Student 2,809 PointsI Am Tired
Challenge task 1 of 2
The array below contains a list of books. Each element in the array has the book’s title as its value and the ISBN as its key. Right now, the page is only displaying the book titles in the browser. In this code challenge, we will modify the page to also display each book’s ISBN. First, we need to make the keys from the books array accessible inside the foreach loop. Modify the foreach command so that, as it loops through the books, it loads the ISBN for each book into a working variable called $isbn.
<?php
$books = array();
$books[0] = "$isbn";
$books = $book(
"978-0743261690" => "Gilgamesh",
"978-0060931957" => "The Odyssey",
"978-0192840509" => "Aesop's Fables",
"978-0520227040" => "Mahabharta",
"978-0393320978" => "Beowulf",
);
?><html>
<head>
<title>Five Great Books</title>
</head>
<body>
<h1>Five Great Books</h1>
<ul>
<?php foreach($books as $book) { ?>
<li><?php echo $book["$isbn"]; ?></li>
<?php } ?>
</ul>
</body>
</html>
Jeff Busch
19,287 PointsCRYSTAL MORRIS
Courses Plus Student 2,809 PointsStone All Of This Started Because I Wanted To Send A Form To An Email Address On A Website That I Built For A Christian Musician. I Am Not Getting Paid For This, This Is Not My Lifes Work Or Anything. I Am Just Tired, I Have Gone Through Almost The Entire Biuild A Simple PHP Just To Get Am Answer To A Simple Question.
What Is The Correct Third Party Software And The Correct Text To Make Sure People Don't Abuse/Spam The Site.
15 Answers
Jeff Busch
19,287 PointsHi CRYSTAL,
Looks to me like the code you supplied was typed in, not copied and pasted, it's too different from the code challenge. It not only will not pass the challenge, it doesn't work. Look at the code below. Copy and paste it into a .php file on your computer and play with it, make changes and see what happens. The "fun" thing about php is if one thing is wrong, probably nothing will work.
Jeff
<?php
$books["978-0743261690"] = "Gilgamesh";
$books["978-0060931957"] = "The Odyssey";
$books["978-0192840509"] = "Aesop's Fables";
$books["978-0520227040"] = "Mahabharta";
$books["978-0393320978"] = "Beowulf";
?>
<html>
<head>
<title>Five Great Books</title>
</head>
<body>
<h1>Five Great Books</h1>
<ul>
<?php foreach($books as $isbn => $book) { ?>
<li><?php echo $book . " (" . $isbn . ")"; ?></li>
<?php } ?>
</ul>
</body>
</html>
Stone Preston
42,016 Pointsthe issue is your for each loop. you need to access the keys of the array in addition to the values. to do that using a for each loop, you would use something like this:
foreach ($array as $key => $value)
however, in this case of the challenge, it the array is named $books, the key working variable needs to be called $isbn, and the value working variable needs to be called $book, leaving you with something that looks like this
<?php
$books["978-0743261690"] = "Gilgamesh";
$books["978-0060931957"] = "The Odyssey";
$books["978-0192840509"] = "Aesop's Fables";
$books["978-0520227040"] = "Mahabharta";
$books["978-0393320978"] = "Beowulf";
?><html>
<head>
<title>Five Great Books</title>
</head>
<body>
<h1>Five Great Books</h1>
<ul>
<?php foreach($books as $isbn => $book) { ?>
<li><?php echo $book; ?></li>
<?php } ?>
</ul>
</body>
</html>
CRYSTAL MORRIS
Courses Plus Student 2,809 PointsThank You, I Would Have Responded Sooner But I Was Too Busy Crying.
CRYSTAL MORRIS
Courses Plus Student 2,809 PointsJeff I Have A Question,
How Can I Align My Website With PHP Mailer???
I Tried To Define These On My Seperate Forms Page And It Wrecked Everything
Notice: Undefined variable: email in C:\xampp\htdocs\WINCHER MUSIC PUBLISHING\maggiewincher.com\contact-thanks.php on line 46
Notice: Undefined variable: name in C:\xampp\htdocs\WINCHER MUSIC PUBLISHING\maggiewincher.com\contact-thanks.php on line 47
Notice: Undefined variable: body in C:\xampp\htdocs\WINCHER MUSIC PUBLISHING\maggiewincher.com\contact-thanks.php on line 49 Message body empty
These Three Right Here:
$mail->From = "$email";
$mail->FromName = "$name";
$mail->MsgHTML($body);
Am Trying To Send A Test Email To Myself
CRYSTAL MORRIS
Courses Plus Student 2,809 Points<?php include('includes/header.php'); ?>
<?php include('includes/style.php'); ?>
<?php ($_SERVER["REQUEST_METHOD"] = "POST"); ?>
<?php
foreach( $_POST as $value ){
if( stripos($value,'Content-Type:') !== FALSE ){
echo "There Was A Problem With The Information You Entered.";
exit;
}
}
require("includes/phpmailer/class.phpmailer.php");
$mail = new PHPMailer(true);
?>
<?php
try {
$mail = new PHPMailer(true); //New instance, with exceptions enabled
$mail->IsSMTP(); // tell the class to use SMTP
$mail->SMTPAuth = true; // enable SMTP authentication
$mail->Port = 25; // set the SMTP server port
$mail->Host = "mail.dreamhost.com"; // SMTP server
$mail->Username = "dreamhost.com"; // SMTP server username
$mail->Password = "b3GvEfR!"; // SMTP server password
$mail->IsSendmail(); // tell the class to use Sendmail
$to = "cemcorp@hotmail.com";
$mail->AddAddress($to);
$mail->Subject = "First PHPMailer Message";
$mail->AltBody = "To view the message, please use an HTML compatible email viewer!"; // optional, comment out and test
$mail->WordWrap = 80; // set word wrap
$mail->From = "$email";
$mail->FromName = "$name";
$mail->MsgHTML($body);
$mail->IsHTML(true); // send as HTML
$mail->Send();
echo 'Message has been sent.';
} catch (phpmailerException $e) {
echo $e->errorMessage();
}
?>
<div class="section page">
<body>
<div class="container clearfix">
<p id="contact-thanks.php"></p><br>
<fieldset>
<legend align="center"><h2>Enjoy Your Day</h2></legend>
<h1>Thanks for completing the form! I'll be in touch shortly. </h1>
</fieldset>
<br>
<br>
<table>
<tr style="display: none;">
<th>
<label for="address">address</label>
</th>
<td>
<input type="text" Name="address" id="address">
</td>
</tr>
</table>
<br>
<a href="index.php" class="btn"><em>Home</a></em><br>
<br>
<br>
<?php include('includes/copyright.php'); ?>
</div>
CRYSTAL MORRIS
Courses Plus Student 2,809 PointsThis Is The PrayerRequest Form,
<?php include('includes/header.php'); ?>
<?php include('includes/style.php'); ?>
<div class="section page">
<body>
<div class="container clearfix">
<form method="POST" action="contact-thanks.php" name="Music Ministry Request Form">
<p id="Prayer Request Form.php"></p><br>
<p>Please fill out the form below:</p>
<p>* Denotes Required Fields</p>
<fieldset>
<legend align="center"><h2>Prayer Request Form</h2></legend>
<label for="First Name *">First Name *</label><br>
<input type="text" name="First Name *" id="First Name *"><br>
<br>
<label for="Last Name *">Last Name *</label><br>
<input type="text" name="Last Name *" id="Last Name *"><br>
<br>
<label for="Address Line 1 *">Address Line 1 *</label><br>
<input type="text" name="Address Line 1 *" id="Address Line 1 *"><br>
<br>
<label for="Address Line 2">Address Line 2</label><br>
<input type="text" name="Address Line 2" id="Address Line 2"><br>
<br>
<label for="City *">City *</label><br>
<input type="text" name="City *" id="City *"><br>
<br>
<label for="State *">State *</label><br>
<input type="text" name="State *" id="State *"><br>
<br>
<label for="Postal Code *">Postal Code *</label><br>
<input type="text" name="Postal Code *" id="Postal Code *"><br>
<br>
<select>
<option>United States</option><br>
<option>Afghanistan</option><br>
<option>Albania</option><br>
<option>Algeria</option><br>
<option>Andorra</option><br>
<option>Angola</option><br>
<option>Antigua and Barbuda</option><br>
<option>Argentina</option><br>
<option>Aruba</option><br>
<option>Australia</option><br>
<option>Austria</option><br>
<option>Azerbaijan</option><br>
<option>Bahamas, The</option><br>
<option>Bahrain</option><br>
<option>Bangladesh</option><br>
<option>Barbados</option><br>
<option>Belarus</option><br>
<option>Belgium</option><br>
<option>Belize</option><br>
<option>Benin</option><br>
<option>Bhutan</option><br>
<option>Bolivia</option><br>
<option>Bosnia and Herzegovina</option><br>
<option>Botswana</option><br>
<option>Brazil</option><br>
<option>Brunei </option><br>
<option>Bulgaria</option><br>
<option>Burkina Faso</option><br>
<option>Burma</option><br>
<option>Burundi</option><br>
<option>Cambodia</option><br>
<option>Cameroon</option><br>
<option>Canada</option><br>
<option>Cape Verde</option><br>
<option>Chad</option><br>
<option>Chile</option><br>
<option>China</option><br>
<option>Colombia</option><br>
<option>Comoros</option><br>
<option>Congo, Democratic Republic of the</option><br>
<option>Costa Rica</option><br>
<option>Cote d'Ivoire</option><br>
<option>Croatia</option><br>
<option>Cuba</option><br>
<option>Curacao</option><br>
<option>Cyprus</option><br>
<option>Czech Republic</option><br>
<option>Denmark</option><br>
<option>Djibouti</option><br>
<option>Dominica</option><br>
<option>Dominican Republic</option><br>
<option>East Timor (see Timor-Leste)</option><br>
<option>Ecuador</option><br>
<option>Egypt</option><br>
<option>El Salvador</option><br>
<option>Equatorial Guinea</option><br>
<option>Eritrea</option><br>
<option>Eritrea</option><br>
<option>Estonia</option><br>
<option>Ethiopia</option><br>
<option>Fiji</option><br>
<option>Finland</option><br>
<option>France</option><br>
<option>Gabon</option><br>
<option>Gambia, The</option><br>
<option>Georgia</option><br>
<option>Germany</option><br>
<option>Ghana</option><br>
<option>Greece</option><br>
<option>Grenada</option><br>
<option>Guatemala</option><br>
<option>Guinea</option><br>
<option>Guinea-Bissau</option><br>
<option>Guyana</option><br>
<option>Haiti</option><br>
<option>Holy See</option><br>
<option>Honduras</option><br>
<option>Hong Kong</option><br>
<option>Hungary</option><br>
<option>Iceland</option><br>
<option>India</option><br>
<option>Indonesia</option><br>
<option>Iran</option><br>
<option>Iraq</option><br>
<option>Ireland</option><br>
<option>Israel</option><br>
<option>Italy</option><br>
<option>Jamaica</option><br>
<option>Japan</option><br>
<option>Jordan</option><br>
<option>Kazakhstan</option><br>
<option>Kenya</option><br>
<option>Kiribati</option><br>
<option>Korea, North</option><br>
<option>Korea, South</option><br>
<option>Kosovo</option><br>
<option>Kuwait</option><br>
<option>Kyrgyzstan</option><br>
<option>Laos</option><br>
<option>Latvia</option><br>
<option>Lebanon</option><br>
<option>Lesotho</option><br>
<option>Liberia</option><br>
<option>Libya</option><br>
<option>Liechtenstein</option><br>
<option>Lithuania</option><br>
<option>Luxembourg</option><br>
<option>Macau</option><br>
<option>Macedonia</option><br>
<option>Madagascar</option><br>
<option>Malawi</option><br>
<option>Malaysia</option><br>
<option>Maldives</option><br>
<option>Mali</option><br>
<option>Malta</option><br>
<option>Marshall Islands</option><br>
<option>Mauritania</option><br>
<option>Mauritius</option><br>
<option>Mexico</option><br>
<option>Micronesia</option><br>
<option>Moldova</option><br>
<option>Monaco</option><br>
<option>Mongolia</option><br>
<option>Montenegro</option><br>
<option>Morocco</option><br>
<option>Mozambique</option><br>
<option>Namibia</option><br>
<option>Nauru</option><br>
<option>Nepal</option><br>
<option>Netherlands</option><br>
<option>Netherlands Antilles</option><br>
<option>New Zealand</option><br>
<option>Nicaragua</option><br>
<option>Niger</option><br>
<option>Nigeria</option><br>
<option>North Korea</option><br>
<option>Norway</option><br>
<option>Oman</option><br>
<option>Pakistan</option><br>
<option>Palau</option><br>
<option>Palestinian Territories</option><br>
<option>Panama</option><br>
<option>Papua New Guinea</option><br>
<option>Paraguay</option><br>
<option>Peru</option><br>
<option>Philippines</option><br>
<option>Poland</option><br>
<option>Portugal</option><br>
<option>Qatar</option><br>
<option>Romania</option><br>
<option>Russia</option><br>
<option>Rwanda</option><br>
<option>Saint Kitts and Nevis</option><br>
<option>Saint Lucia</option><br>
<option>Saint Vincent and the Grenadines</option><br>
<option>Samoa</option><br>
<option>San Marino</option><br>
<option>Sao Tome and Principe</option><br>
<option>Saudi Arabia</option><br>
<option>Senegal</option><br>
<option>Serbia</option><br>
<option>Seychelles</option><br>
<option>Sierra Leone</option><br>
<option>Singapore</option><br>
<option>Sint Maarten</option><br>
<option>Slovakia</option><br>
<option>Slovenia</option><br>
<option>Solomon Islands</option><br>
<option>Somalia</option><br>
<option>South Africa</option><br>
<option>South Sudan</option><br>
<option>Spain</option><br>
<option>Sri Lanka</option><br>
<option>Sudan</option><br>
<option>Suriname</option><br>
<option>Swaziland</option><br>
<option>Sweden</option><br>
<option>Switzerland</option><br>
<option>Syria</option><br>
<option>Taiwan</option><br>
<option>Tajikistan</option><br>
<option>Tanzania</option><br>
<option>Thailand</option><br>
<option>Timor-Leste</option><br>
<option>Togo</option><br>
<option>Trinidad and Tobago</option><br>
<option>Tunisia</option><br>
<option>Turkey</option><br>
<option>Turkmenistan</option><br>
<option>Tuvalu</option><br>
<option>Uganda</option><br>
<option>Ukraine</option><br>
<option>United Arab Emirates</option><br>
<option>United Kingdom</option><br>
<option>Uruguay</option><br>
<option>Uzbekistan</option><br>
<option>Vanuatu</option><br>
<option>Venezuela</option><br>
<option>Vietnam</option><br>
<option>Yemen</option><br>
<option>Zambia</option><br>
<option>Zimbabwe</option><br>
</select><br>
<br>
<label for="Phone *">Phone *</label><br>
<input type="text" name="Phone *" id="Phone *"><br>
<br>
<label for="Fax">Fax</label><br>
<input type="text" name="Fax" id="Fax"><br>
<br>
<label for="Email *">Email *</label><br>
<input type="text" name="Email *" id="Email *"><br>
<br>
<label for="Your Title">Your Title</label><br>
<input type="text" name="Your Title" id="Your Title"><br>
<br>
<label for="Praise Report">Prayer Request</label><br>
<textarea name="Praise Report" rows="3" cols="30"></textarea><br>
</fieldset>
<br>
<input type="submit" value="Send"><br>
<br>
<br>
<br>
<a href="index.php" class="btn"><em>Home</a></em><br>
<br>
<br>
<?php include('includes/copyright.php'); ?>
</div>
Jeff Busch
19,287 PointsHi CRYSTAL,
I'll take a look but to be honest we are starting to get a little over my head here. If I had all the code I'm sure it would be a good learning experience for me.
Having said that I ran some of the html code through w3.org's code validator because I noticed white spaces in the values for the id attributes in the form input elements. And sure enough, that isn't allowed. I make it a practice to never use white spaces when naming anything in my code; files, directories, you name it. To make it more readable I use dashes, underscores, or Camel Capitalizing. So therefore <label for="Last Name *" can't contain a white space either. In the Prayer Request Form file I noticed a div above the body tag, this is not correct. Also, I copied and pasted the code you supplied into my text editor and noticed that none of the divs had matching tags. Even the form tag didn't seen to have a closing tag.
As far as lines 46, 47, and 49 go...in the example php mailer code I have looked at $mail->From = "$email"; etc. should be like this: $mail-> = "email";. I haven't seen a variable assigned to the $mail array. If I had all the files involved with this process I might be able to figure this out. If you want you can copy the files with a .txt extension and supply links, that way the server will serve up the php code. If you don't want to post the links here I will supply an email address.
Sorry I couldn't be more help, Jeff
CRYSTAL MORRIS
Courses Plus Student 2,809 PointsWOW!!! You Gave Been Very Helpful, I Have Bever Done This Before. Yes I Would Like An Email Address. I Could Post The Forms Here, I Also Have Team Viewer.
I Will Remove The White Space, I Used The * To Indicate Manditory Fields.
This Is My Cell Could You Give Me Call??? 313-410-1550
CRYSTAL MORRIS
Courses Plus Student 2,809 PointsRevised Praise Report
<?php include('includes/header.php'); ?>
<?php include('includes/style.php'); ?>
<div class="section page">
<body>
<div class="container clearfix">
<form method="POST" action="contact-thanks.php" name="Music Ministry Request Form">
<p id="Prayer Request Form.php"></p><br>
<p>Please fill out the form below:</p>
<p>* Denotes Required Fields</p>
<fieldset>
<legend align="center"><h2>Prayer Request Form</h2></legend>
<label for="FirstName*">First Name*</label><br>
<input type="text" name="FirstName*" id="FirstName*"><br>
<br>
<label for="LastName *">Last Name *</label><br>
<input type="text" name="LastName *" id="LastName*"><br>
<br>
<label for="AddressLine1*">Address Line 1 *</label><br>
<input type="text" name="AddressLine1*" id="AddressLine1*"><br>
<br>
<label for="AddressLine2">Address Line 2</label><br>
<input type="text" name="AddressLine2" id="AddressLine2"><br>
<br>
<label for="City*">City *</label><br>
<input type="text" name="City*" id="City*"><br>
<br>
<label for="State*">State *</label><br>
<input type="text" name="State*" id="State*"><br>
<br>
<label for="PostalCode*">Postal Code *</label><br>
<input type="text" name="PostalCode*" id="PostalCode*"><br>
<br>
<select>
<option>United States</option><br>
<option>Afghanistan</option><br>
<option>Albania</option><br>
<option>Algeria</option><br>
<option>Andorra</option><br>
<option>Angola</option><br>
<option>Antigua and Barbuda</option><br>
<option>Argentina</option><br>
<option>Aruba</option><br>
<option>Australia</option><br>
<option>Austria</option><br>
<option>Azerbaijan</option><br>
<option>Bahamas, The</option><br>
<option>Bahrain</option><br>
<option>Bangladesh</option><br>
<option>Barbados</option><br>
<option>Belarus</option><br>
<option>Belgium</option><br>
<option>Belize</option><br>
<option>Benin</option><br>
<option>Bhutan</option><br>
<option>Bolivia</option><br>
<option>Bosnia and Herzegovina</option><br>
<option>Botswana</option><br>
<option>Brazil</option><br>
<option>Brunei </option><br>
<option>Bulgaria</option><br>
<option>Burkina Faso</option><br>
<option>Burma</option><br>
<option>Burundi</option><br>
<option>Cambodia</option><br>
<option>Cameroon</option><br>
<option>Canada</option><br>
<option>Cape Verde</option><br>
<option>Chad</option><br>
<option>Chile</option><br>
<option>China</option><br>
<option>Colombia</option><br>
<option>Comoros</option><br>
<option>Congo, Democratic Republic of the</option><br>
<option>Costa Rica</option><br>
<option>Cote d'Ivoire</option><br>
<option>Croatia</option><br>
<option>Cuba</option><br>
<option>Curacao</option><br>
<option>Cyprus</option><br>
<option>Czech Republic</option><br>
<option>Denmark</option><br>
<option>Djibouti</option><br>
<option>Dominica</option><br>
<option>Dominican Republic</option><br>
<option>East Timor (see Timor-Leste)</option><br>
<option>Ecuador</option><br>
<option>Egypt</option><br>
<option>El Salvador</option><br>
<option>Equatorial Guinea</option><br>
<option>Eritrea</option><br>
<option>Eritrea</option><br>
<option>Estonia</option><br>
<option>Ethiopia</option><br>
<option>Fiji</option><br>
<option>Finland</option><br>
<option>France</option><br>
<option>Gabon</option><br>
<option>Gambia, The</option><br>
<option>Georgia</option><br>
<option>Germany</option><br>
<option>Ghana</option><br>
<option>Greece</option><br>
<option>Grenada</option><br>
<option>Guatemala</option><br>
<option>Guinea</option><br>
<option>Guinea-Bissau</option><br>
<option>Guyana</option><br>
<option>Haiti</option><br>
<option>Holy See</option><br>
<option>Honduras</option><br>
<option>Hong Kong</option><br>
<option>Hungary</option><br>
<option>Iceland</option><br>
<option>India</option><br>
<option>Indonesia</option><br>
<option>Iran</option><br>
<option>Iraq</option><br>
<option>Ireland</option><br>
<option>Israel</option><br>
<option>Italy</option><br>
<option>Jamaica</option><br>
<option>Japan</option><br>
<option>Jordan</option><br>
<option>Kazakhstan</option><br>
<option>Kenya</option><br>
<option>Kiribati</option><br>
<option>Korea, North</option><br>
<option>Korea, South</option><br>
<option>Kosovo</option><br>
<option>Kuwait</option><br>
<option>Kyrgyzstan</option><br>
<option>Laos</option><br>
<option>Latvia</option><br>
<option>Lebanon</option><br>
<option>Lesotho</option><br>
<option>Liberia</option><br>
<option>Libya</option><br>
<option>Liechtenstein</option><br>
<option>Lithuania</option><br>
<option>Luxembourg</option><br>
<option>Macau</option><br>
<option>Macedonia</option><br>
<option>Madagascar</option><br>
<option>Malawi</option><br>
<option>Malaysia</option><br>
<option>Maldives</option><br>
<option>Mali</option><br>
<option>Malta</option><br>
<option>Marshall Islands</option><br>
<option>Mauritania</option><br>
<option>Mauritius</option><br>
<option>Mexico</option><br>
<option>Micronesia</option><br>
<option>Moldova</option><br>
<option>Monaco</option><br>
<option>Mongolia</option><br>
<option>Montenegro</option><br>
<option>Morocco</option><br>
<option>Mozambique</option><br>
<option>Namibia</option><br>
<option>Nauru</option><br>
<option>Nepal</option><br>
<option>Netherlands</option><br>
<option>Netherlands Antilles</option><br>
<option>New Zealand</option><br>
<option>Nicaragua</option><br>
<option>Niger</option><br>
<option>Nigeria</option><br>
<option>North Korea</option><br>
<option>Norway</option><br>
<option>Oman</option><br>
<option>Pakistan</option><br>
<option>Palau</option><br>
<option>Palestinian Territories</option><br>
<option>Panama</option><br>
<option>Papua New Guinea</option><br>
<option>Paraguay</option><br>
<option>Peru</option><br>
<option>Philippines</option><br>
<option>Poland</option><br>
<option>Portugal</option><br>
<option>Qatar</option><br>
<option>Romania</option><br>
<option>Russia</option><br>
<option>Rwanda</option><br>
<option>Saint Kitts and Nevis</option><br>
<option>Saint Lucia</option><br>
<option>Saint Vincent and the Grenadines</option><br>
<option>Samoa</option><br>
<option>San Marino</option><br>
<option>Sao Tome and Principe</option><br>
<option>Saudi Arabia</option><br>
<option>Senegal</option><br>
<option>Serbia</option><br>
<option>Seychelles</option><br>
<option>Sierra Leone</option><br>
<option>Singapore</option><br>
<option>Sint Maarten</option><br>
<option>Slovakia</option><br>
<option>Slovenia</option><br>
<option>Solomon Islands</option><br>
<option>Somalia</option><br>
<option>South Africa</option><br>
<option>South Sudan</option><br>
<option>Spain</option><br>
<option>Sri Lanka</option><br>
<option>Sudan</option><br>
<option>Suriname</option><br>
<option>Swaziland</option><br>
<option>Sweden</option><br>
<option>Switzerland</option><br>
<option>Syria</option><br>
<option>Taiwan</option><br>
<option>Tajikistan</option><br>
<option>Tanzania</option><br>
<option>Thailand</option><br>
<option>Timor-Leste</option><br>
<option>Togo</option><br>
<option>Trinidad and Tobago</option><br>
<option>Tunisia</option><br>
<option>Turkey</option><br>
<option>Turkmenistan</option><br>
<option>Tuvalu</option><br>
<option>Uganda</option><br>
<option>Ukraine</option><br>
<option>United Arab Emirates</option><br>
<option>United Kingdom</option><br>
<option>Uruguay</option><br>
<option>Uzbekistan</option><br>
<option>Vanuatu</option><br>
<option>Venezuela</option><br>
<option>Vietnam</option><br>
<option>Yemen</option><br>
<option>Zambia</option><br>
<option>Zimbabwe</option><br>
</select><br>
<br>
<label for="Phone*">Phone *</label><br>
<input type="text" name="Phone*" id="Phone*"><br>
<br>
<label for="Fax">Fax</label><br>
<input type="text" name="Fax" id="Fax"><br>
<br>
<label for="Email*">Email *</label><br>
<input type="text" name="Email*" id="Email*"><br>
<br>
<label for="YourTitle">Your Title</label><br>
<input type="text" name="YourTitle" id="YourTitle"><br>
<br>
<label for="PraiseReport">Prayer Request</label><br>
<textarea name="PraiseReport" rows="3" cols="30"></textarea><br>
</fieldset>
<br>
<input type="submit" value="Send"><br>
<br>
<br>
<br>
<a href="index.php" class="btn"><em>Home</a></em><br>
<br>
<br>
</div>
<?php include('includes/copyright.php'); ?>
</body>
</div>
CRYSTAL MORRIS
Courses Plus Student 2,809 PointsContact - Thanks.PHP (Mailer)
<?php include('includes/header.php'); ?>
<?php include('includes/style.php'); ?>
<?php ($_SERVER["REQUEST_METHOD"] = "POST"); ?>
<?php
foreach( $_POST as $value ){
if( stripos($value,'Content-Type:') !== FALSE ){
echo "There Was A Problem With The Information You Entered.";
exit;
}
}
require_once("includes/phpmailer/class.phpmailer.php");
$mail = new PHPMailer(true);
$mail = new PHPMailer();
$mail->IsSMTP(); // telling the class to use SMTP
?>
<?php
/**
* Simple example script using PHPMailer with exceptions enabled
* @package phpmailer
* @version $Id$
*/
try {
$mail = new PHPMailer(true); //New instance, with exceptions enabled
$mail->IsSMTP(); // tell the class to use SMTP
$mail->SMTPAuth = true; // enable SMTP authentication
$mail->Port = 25; // set the SMTP server port
$mail->Host = "mail.dreamhost.com"; // SMTP server
$mail->Username = "dreamhost.com"; // SMTP server username
$mail->Password = "b3GvEfR!"; // SMTP server password
$mail->IsSendmail(); // tell the class to use Sendmail
$to = "cemcorp@hotmail.com";
$mail->AddAddress($to);
$mail->Subject = "First PHPMailer Message";
$mail->AltBody = "To view the message, please use an HTML compatible email viewer!"; // optional, comment out and test
$mail->WordWrap = 80; // set word wrap
$mail->MsgHTML($body);
$mail->IsHTML(true); // send as HTML
$mail->Send();
echo 'Message has been sent.';
} catch (phpmailerException $e) {
echo $e->errorMessage();
}
?>
<div class="section page">
<body>
<div class="container clearfix">
<p id="contact-thanks.php"></p><br>
<fieldset>
<legend align="center"><h2>Enjoy Your Day</h2></legend>
<h1>Thanks for completing the form! I'll be in touch shortly. </h1>
</fieldset>
<br>
<br>
<table>
<tr style="display: none;">
<th>
<label for="address">address</label>
</th>
<td>
<input type="text" Name="address" id="address">
</td>
</tr>
</table>
<br>
<a href="index.php" class="btn"><em>Home</a></em><br>
<br>
<br>
<?php include('includes/copyright.php'); ?>
</div>
CRYSTAL MORRIS
Courses Plus Student 2,809 PointsThe Tags Were Moved To Copyright Tag Which Is My Footer, I Also Made A Header For My Includes File. I Learbed That Looking At The Stuff For PHP. :-)
CRYSTAL MORRIS
Courses Plus Student 2,809 PointsThe Tags Were Moved To Copyright Tag Which Is My Footer, I Also Made A Header For My Includes File. I Learned That Looking At The Stuff For PHP. :-)
CRYSTAL MORRIS
Courses Plus Student 2,809 PointsHere Is My Header PHP
<!DOCTYPE HTML>
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<meta itemprop="name" content="Dr. Maggie Wincher Music Ministries">
<meta itemprop="description" content="The mission of Dr. Maggie Wincher Music Ministries is to aggressively fulfill the commission that Jesus Christ gave to His followers to go into the world and make disciples of all people. My purpose is to bring the lost to Jesus Christ and to build up and encourage those who are already believers.">
<meta itemprop="image" content="http://www.http://maggiewincher.com/dr._maggie_wincher.png">
<link rel="stylesheet" href="css/maggiesnormalize.css" type="text/css" media="screen">
<link rel="stylesheet" href="css/maggiesgrid.css" type="text/css" media="screen">
<link rel="stylesheet" href="css/maggiesstyle.css" type="text/css" media="screen">
<link href='http://fonts.googleapis.com/css?family=Nunito:400,300,700' rel='stylesheet' type='text/css'>
<link rel="shortcut icon" href="new.ico" >
<meta name="viewport" content="width=device-width, initial-scale = 1.0">
<script>document.cookie='resolution='+Math.max(screen.width,screen.height)+'; path=/';</script>
</head>
Here Is The Footer/Copywrite
<div id="copyright" class="grid_12">
<p>©<?php echo date("Y"); ?> Wincher Music Publishing Company. All Rights Reserved.</p>
</div>
</div>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
<script>
$( function() {
causeRepaintsOn= $("h1, h2, h3, a, p");
$(window).resize(function) {
causeRepaintsOn.css("z-index, 1");
});
});
</script>
</body>
</html>
CRYSTAL MORRIS
Courses Plus Student 2,809 Points<?php include('includes/header.php'); ?>
<?php include('includes/style.php'); ?>
<?php ($_SERVER["REQUEST_METHOD"] = "POST"); ?>
<?php
foreach( $_POST as $value ){
if( stripos($value,'Content-Type:') !== FALSE ){
echo "There Was A Problem With The Information You Entered.";
exit;
}
}
require_once("includes/phpmailer/class.phpmailer.php");
$mail = new PHPMailer(true);
$mail = new PHPMailer();
$mail->IsSMTP(); // telling the class to use SMTP
?>
<?php
/**
* Simple example script using PHPMailer with exceptions enabled
* @package phpmailer
* @version $Id$
*/
try {
$mail = new PHPMailer(true); //New instance, with exceptions enabled
$mail->IsSMTP(); // tell the class to use SMTP
$mail->SMTPAuth = true; // enable SMTP authentication
$mail->Port = 25; // set the SMTP server port
$mail->Host = "mail.dreamhost.com"; // SMTP server
$mail->Username = "dreamhost.com"; // SMTP server username
$mail->Password = "b3GvEfR!"; // SMTP server password
$mail->IsSendmail(); // tell the class to use Sendmail
$mail-> = "email"
$to = "cemcorp@hotmail.com";
$mail->AddAddress($to);
$mail->Subject = "First PHPMailer Message";
$mail->AltBody = "To view the message, please use an HTML compatible email viewer!"; // optional, comment out and test
$mail->WordWrap = 80; // set word wrap
$mail->MsgHTML($body);
$mail->IsHTML(true); // send as HTML
$mail->Send();
echo 'Message has been sent.';
} catch (phpmailerException $e) {
echo $e->errorMessage();
}
?>
<div class="section page">
<body>
<div class="container clearfix">
<p id="contact-thanks.php"></p><br>
<fieldset>
<legend align="center"><h2>Enjoy Your Day</h2></legend>
<h1>Thanks for completing the form! I'll be in touch shortly. </h1>
</fieldset>
<br>
<br>
<table>
<tr style="display: none;">
<th>
<label for="address">address</label>
</th>
<td>
<input type="text" Name="address" id="address">
</td>
</tr>
</table>
<br>
<a href="index.php" class="btn"><em>Home</a></em><br>
<br>
<br>
<?php include('includes/copyright.php'); ?>
</div>
CRYSTAL MORRIS
Courses Plus Student 2,809 PointsI Have Made Some Progress...YAY!!! It Says Could not execute: /var/qmail/bin/sendmail
(I Added An Id Called form)
I Changed The Form And The Fieldset On The Praise Report Form:
<form method="POST" action="contact-thanks.php" id="form" name="Music Ministry Request Form">
<fieldset form="form">
I Changed Line 57 To This:
$mail->MsgHTML(form);
Stone Preston
42,016 PointsStone Preston
42,016 Pointscan you provide a link to the challenge please?