Page shows up blank
Posted: Wed May 31, 2006 2:03 pm
I can't seem to get this to work. I am trying to get a page to display only if they entered there e-mail address, and for other purposes, I want it to store it in a session (a cookie might also work).
Thanx
Code: Select all
<?php
session_start();
$email= $_post["email"];
$recipient="test@test.com";
$subject="A survey has been submited";
$msg="E-Mail Address: $email";
if (count($_SESSION['email'])>0){
print "This is the survey";
}
elseif ($email='')
{
print "Please enter a valid e-mail address to continue: <p>";
print "<form action=\"$SERVER[self_php]\" method=\"post\">
Email: <input name=\"email\" type=\"test\" size=\"20\" maxlength=\"100\"><p>
<input name=\"Submit\" type=\"submit\" value=\"Submit\">";
}
elseif(mail($recipient, $subject, $msg)){
$_SESSION['email'][] = array('email' => $email);
}
?>