Hi, I know this has been covered before and normally im fine with it.
But today logic escapes me.
Can any body see how i can make these forms sticky?
[url]http://www.inboxdesign.co.nz/dev/insurelink/register
(I cant paste the whole thing so i have chopped out bits
[code=php]<?php
ob_start(“ob_gzhandler”);
session_start();
$seo_title = “InsureLink | Register to insure”;
$seo_pagetitle = “Registration”;
$seo_description = “Register with insurelink, the insurance portfolio database”;
$seo_keywords = “register, insurelinlk,insurance,join”;
include(“files/connect.php”);
if(isset($_GET[‘step’]) and !empty($_GET[‘step’])){
$step = $_GET[‘step’];
}else{
header(“Location: register,1”);
}
//step one is correct?
if(isset($_POST[‘privacypage’])){
if(empty($_POST[‘agree’])){
header(“Location: register,1.”.htmlentities(urlencode(‘You must agree to the terms and conditions’)));
}else{
unset($_SESSION[‘clientid’]);
header(“Location; register,2”);
}
}
//step two, confirm email doesnt exsits and passwords match
if(isset($_POST[’emaildata’])){
if(empty($_POST[’email’]) or preg_match(“/^( [a-zA-Z0-9] )+( [a-zA-Z0-9._-] )*@( [a-zA-Z0-9_-] )+([a-zA-Z0-9._-] +)+$/” , $_POST[’email’])){
header(“Location: register,2.”.htmlentities(urlencode(‘You must enter a valid email address’)));
}elseif(empty($_POST[‘name’])){
header(“Location: register,2.”.htmlentities(urlencode(‘You must enter your full name’)));
}elseif(empty($_POST[‘password1’]) or empty($_POST[‘password2’])){
header(“Location: register,2.”.htmlentities(urlencode(‘You must enter your password twice’)));
}elseif($_POST[‘password1’] != $_POST[‘password2’]){
header(“Location: register,2.”.htmlentities(urlencode(‘You must enter both passwords the same’)));
}else{
mysql_query(“INSERT INTO clients (`email`, `name`,`password`) VALUES (‘”.$_POST[’email’].”‘, ‘”.$_POST[‘name’].”‘, ‘”.$_POST[‘password1’].”‘)”) or die (“Database Error”. mysql_error());
$_SESSION[‘clientid’] = mysql_insert_id();
header(“Location; register,3”);
}
}
//step three, find out the clients information
if(isset($_POST[‘policy’])){
if(empty($_POST[‘policyname’])){
header(“Location: register,3.”.htmlentities(urlencode(‘You must enter policy name’)));
}elseif(empty($_POST[‘insurer’])){
header(“Location: register,3.”.htmlentities(urlencode(‘You must enter insurer’)));
}elseif(empty($_POST[‘policynumber’])){
header(“Location: register,3.”.htmlentities(urlencode(‘You must enter your policy number’)));
}elseif(empty($_POST[‘dob1’]) or empty($_POST[‘dob1’]) or ($_POST[‘dob1’] != $_POST[‘dob2’])){
header(“Location: register,3.”.htmlentities(urlencode(‘You must enter a valid Date of birth’)));
}elseif(empty($_POST[‘phone1’])){
header(“Location: register,3.”.htmlentities(urlencode(‘You must enter a valid phone number’)));
}elseif(empty($_POST[‘address1’]) or empty($_POST[‘address2’]) or empty($_POST[‘address3’]) or empty($_POST[‘country’])){
header(“Location: register,3.”.htmlentities(urlencode(‘You must enter your valid Address’)));
}else{
mysql_query(“UPDATE clients SET dob = ‘”.$_POST[‘dob1’].”‘,
policyname = ‘”.$_POST[‘policyname’].”‘,
insurer = ‘”.$_POST[‘insurer’].”‘,
policynumber = ‘”.$_POST[‘policynumber’].”‘,
reference = ‘”.$_POST[‘reference’].”‘,
notes = ‘”.$_POST[‘notes’].”‘,
phone1 = ‘”.$_POST[‘phone1’].”‘,
phone2 = ‘”.$_POST[‘phone2’].”‘,
address1 = ‘”.$_POST[‘address1’].”‘,
address2 = ‘”.$_POST[‘address2’].”‘,
address3 = ‘”.$_POST[‘address3’].”‘,
country = ‘”.$_POST[‘country’].”‘,
ip = ‘”.$_SERVER[‘REMOTE_HOST’].”‘
WHERE id = ‘”.$_SESSION[‘clientid’].”‘”) or die (“Database Error”. mysql_error());
header(“Location; register,4”);
}
}
if(isset($_GET[‘note’]) and !empty($_GET[‘note’])){
$note = $_GET[‘note’];
}
include(“files/header.php”);
?>
<h2>Registration (Step <?php echo($step); ?> of 4)</h2>
<?
if(isset($note)){
echo(“<div class=”Warnings”>
<strong>We came across some problems;</strong>
<div class=”Error”>”.$note.”</div>
</div>”.”rn”);
}
/*step 1*/ if($step == “1”) {?>
<p>Please read our privacy policy & terms and conditions of use.</p>
<code><strong>Privacy Policy</strong>
privacy policy
.</code>
<form method=”post” action=”register,2″>
<input type=”checkbox” name=”agree” />I have read and agree to the above stated agreement.*
<input type=”hidden” name=”privacypage” value=”privacypage” />
<div class=”Button”><input type=”submit” value=”Click here to confirm your agreement and proceed to the next step” /></div>
</form>
<?php
/* Step 2 */ }elseif($step == 2){?>
<p>Create your new account, please specify your details below:</p>
<fieldset>
<form method=”post” action=”register,3″>
<input type=”hidden” name=”emaildata” value=”emaildata” />
<ul>
<li>
<label for=”email”>E-mail address*</label>
<input type=”text” id=”email” name=”email” value=”<?php if(isset($_POST[’email’])){ echo($_POST[’email’]); } ?>” />
</li>
<li>
<label for=”name”>Full Name*</label>
<input type=”text” id=”name” name=”name” value=”<?php if(isset($_POST[‘name’])){ echo($_POST[‘name’]); } ?>” />
</li>
<li>
<label for=”password1″>Password*</label>
<input type=”password” id=”password1″ name=”password1″ value=”” />
</li>
<li>
<label for=”password2″>Password Verify*</label>
<input type=”password” id=”password2″ name=”password2″ value=”” />
</li>
</ul>
<div class=”Button”><input type=”submit” value=”Click here to create your profile and proceed to the next step” /></div>
</form>
</fieldset>
<?php
/*step 3*/ }elseif($step == 3){?>
STEP THREE
<?php
/*step 4*/ }elseif($step == 4){
STEP FOUR
<?php
}
?>
<div class=”redbanner”>* = Required field</div>
<?php
include(“files/footer.php”);
?>
Thanks