Code: Select all
if ($fname == '' or $lname == '' or $email == '' or $cemail == '' or $guests == '' or $pswd == '' or $cpswd == ''); {
echo $errmsg3; }Moderator: General Moderators
Code: Select all
if ($fname == '' or $lname == '' or $email == '' or $cemail == '' or $guests == '' or $pswd == '' or $cpswd == ''); {
echo $errmsg3; }Code: Select all
<?
if(empty($_POST['fname']) || empty($_POST['lname']) || ...
?>Code: Select all
//Check to make sure all fields were filled out
if(empty($_POST['firstname']) || empty($_POST['lastname']) || empty($_POST['email']) || empty($_POST['cemail']) || empty($_POST['guests']) || empty($_POST['pswd']) || empty($_POST['cpswd']));
{
echo $errmsg3;
}Code: Select all
if ($pswd != $cpswd) {echo $errmsg1;}Code: Select all
,Code: Select all
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]
Here is the full code for register.php :
[syntax="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" xml:lang="en" lang="en">
<head>
<title>Well Heeled Society ~ Who says you have to be married to get great gifts? </title>
<link rel="stylesheet" type="text/css" href="css/whs.css">
</head>
<body>
<?php require ("connect.php"); ?>
<!-- Outer Container / Centers Content -->
<div id="wrap">
<div id="header"></div>
<div id="navigation"><?php include ('navigation.php'); ?></div>
<!-- Main Content Area -->
<div id="main-content">
<div id="searchwrap"><div class="searchform1"><form name="search" action="search.php" method="post">Registry Search : <input type="text" name="terms" size="15"> <input type="submit" value="Search" class="button"></form></div></div>
<div id="main">
<div id="regform"><div class="regformtext"><p> </p><br /><br />
<form name="register" action="registration.php" method="post">
First Name : <input type="text" name="firstname" size="15" /><br /><br />
Last Name : <input type="text" name="lastname" size="15" /><br /><br />
E-mail Address : <input type="text" name="email" size="15" /><br /><br />
Confirm e-mail : <input type="text" name="cemail" size="15" /><br /><br />
Guest Email addresses : <input type="text" name="guests" size="25"/><br />
<span class="smallprint">(<a href="privacy.php">read our privacy policy</a>) (please seperate each address with a comma)</span><br /><br />
Choose a password : <input type="text" name="pswd" size="15" /><br /><br />
Confirm password : <input type="text" name="cpswd" size="15" /><br /><br />
<span align="center"><input type="submit" value="submit" class="button" /></span></form></div></div>
<p> </p>
<p align="center"> <script src="http://www.joinred.com/hookup/assets.asp?ori=1026&sel=ba5"></script> </p>
</div>
<!-- Begin #footer :: bottom area -->
<div id="footer">
<?php include('footer.php'); ?>
</p>
</div>
</div>
<!-- End #main-content -->
<div id="main-bot"></div>
</div>
</body>
</html>
Code: Select all
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
<title>Well Heeled Society ~ Who says you have to be married to get great gifts?</title>
<link rel="stylesheet" type="text/css" href="css/whs.css" />
<?php require('connect.php'); ?>
<?php
$fname = $_POST['firstname'];
$lname = $_POST['lastname'];
$email = $_POST['email'];
$cemail = $_POST['cemail'];
$guests = $_POST['guests'];
$pswd = $_POST['pswd'];
$cpswd = $_POST['cpswd'];
$errmsg1 = ('Your passwords don\'t match. Please go back and resubmit the registration form.');
$errmsg2 = ('That email address is already linked to an account!');
$errmsg3 = ('You left some fields blank. Please go back and resubmit the registration form.');
?>
</head>
<body>
<div id="wrap">
<div id="header"></div>
<div id="navigation"><?php include ('navigation.php'); ?></div>
<!-- Main Content Area -->
<div id="main-content">
<div id="searchwrap"><div class="searchform1"><form name="search" action="search.php" method="post">Registry Search : <input type="text" name="terms" size="15"> <input type="submit" value="Search" class="button"></form></div></div>
<div id="main">
<?php echo $fname; ?><br />
<?php echo $lname; ?><br />
<?php echo $email; ?><br />
<?php echo $cemail; ?><br />
<?php echo $guests; ?><br />
<?php echo $pswd; ?><br />
<?php echo $cpswd; ?><br />
<?php
//Confirm the password
if ($pswd != $cpswd) {
echo $errmsg1; }
//Check to make sure all fields were filled out
if(empty($_POST['firstname']) || empty($_POST['lastname']) || empty($_POST['email']) || empty($_POST['cemail']) || empty($_POST['guests']) || empty($_POST['pswd']) || empty($_POST['cpswd']));
{
echo $errmsg3;
}
?>
<p> </p>
<p align="center"> <script src="http://www.joinred.com/hookup/assets.asp?ori=1026&sel=ba5"></script> </p>
</div>
<div id="footer"><?php include ('footer.php'); ?></div>
</div>
</body>
</html>Code: Select all
,Code: Select all
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]Code: Select all
<?
print_r($_POST);
?>Code: Select all
if(empty($_POST['firstname']) || empty($_POST['lastname']) || empty($_POST['email']) || empty($_POST['cemail']) || empty($_POST['guests']) || empty($_POST['pswd']) || empty($_POST['cpswd']));
{
echo $errmsg3;
}Code: Select all
if(empty($_POST['firstname']) || empty($_POST['lastname']) || empty($_POST['email']) || empty($_POST['cemail']) || empty($_POST['guests']) || empty($_POST['pswd']) || empty($_POST['cpswd']))
{
echo $errmsg3;
}