Here's a snippet of code from the contact form that I haven't gone over yet. By the time you read this, it'll be fixed since it's open in Notepad++, but this is as it stands as of posting:
PHP Code:
<?php
$loggedin=notnecessary;
include "header.php";
if(isset($_GET['email'])){
$name=$_POST['name'];
$subject=$_POST['subject'];
$emailaddy=$_POST['emailaddy'];
$email=$_POST['email'];
$to="[REDACTED]";
$subject = "Contact Form";
$body = "From: $name\nSubject: $subject\nEmail Address: $emailaddy\n\n
$email";
$from_header="From: [REDACTED]";
mail($to,$subject,$body,$from_header);
print "Email successfully sent.";
include "footer.php";
exit;
}
print "<form method=post action=contact.php?email=yes>
Your Name: <input type=text name=name><br>
Your Email: <input type=text name=emailaddy><br>
Subject: <input type=text name=subject><br>
<textarea rows=20 cols=30 name=email>Email content here.</textarea><br>
<input type=submit name=submit value='Send Email'></form>";
include "footer.php";
?>
Oh, and no, it was not indented. Personally I enclose all my functions with parentheses to make it explicit. aka: echo("foo"); include("foo"); and I don't use print for anything.
Bookmarks