prasanthmj,
I adapted your code but it doesn't seem to be working?!
I stepped through my code in NetBeans and the array is receiving a value...
Code:
<?php
// Start output buffering
//ob_start();
// Initialize a session
session_start();
// Initialize $errors array
$errors= array();
if (isset($_POST['submitted'])) {
// Handle the form.
echo "For was submitted!";
if(empty($_POST['email'])) {
$errors['name']='E-mail is required';
}
if(empty($errors)) {
//validation success
//send email, save to db ...
header('Location: thankyou.html');
}
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en-US">
<head>
<title>Sign-In/Create Account</title>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<!--<link rel="stylesheet" type="text/css" href="tabs.css" />-->
<style type="text/css">
</style>
</head>
<body>
<h2>Registering is quick and easy...</h2>
<!-- <form action="104_CreateUser.xhtml" method="post"> -->
<form action="103_SignIn.php" method="post">
<ol>
<!-- a.) E-MAIL ADDRESS -->
<li class="step">
<label for="email">Enter your e-mail address:</label>
<input id="email" type="text" name="email" size="30" maxlength="80" />
<?php if(isset($errors['email'])) echo $errors['email']; ?>
</li>
</ol>
<!-- HIDDEN INPUT -->
<input type="hidden" name="submitted" value="TRUE" />
<!-- PROCEED BUTTON -->
<input type="image" src="images/Proceed.jpg"
alt="Proceed" class="proceed" border="0" />
</form>
</div>
</div>
</body>
</html>
What am I doing wrong?
Amy
Bookmarks