Jump to content

Recommended Posts

Hi

 

This is my code for checkboxes to stay checked if submition fails:

$check = array();

if(isset($_POST['home1'])) $check[] = $_POST['home1'];


$all = count($check);
$at = ($all == 0) ? 1 : 0;


<input type="checkbox" name="home1" id="home1" value="home1" <?php if($at <= $all && $check[$at] == home1) {echo 'checked'; $at++;}?>/

How do I modify this so if registration fails for any reason the data that user already insert not to disappear?

 

Thank you

  <th scope="col"><form action="register.php" method="post" enctype="application/x-www-form-urlencoded" name="register" id="register">
      <div align="center">
        <div align="left">
          <pre><span class="style71">
Full Name:</span>	<input name="Full_Name" type="text" id="Full_Name" size="50" maxlength="19" value='<?php echo $Full_Name;?>'><span class="style71">	Birthday:  </span><input name="Birthday" type="text" id="Birthday" size="12" maxlength="10" />		    <span class="style75">    accounts</span>
								<span class="style69">    (dd-mm-yyyy)</span>

<span class="style71">Mail:</span>		<input name="Mail" type="text" size="89" maxlength="77" id="Mail" />	<span class="style75">	with false statements</span>
		<span class="style69"> (Street-Street No-Territory-Postal Code-Town-Country)</span>

<span class="style71">E-mail:</span>		<input name="E_Mail" type="text" size="30" maxlength="30" id="E_Mail" />	<span class="style71">Phone No:</span>	<input name="Phone_No" type="text" id="Phone_No" size="25" maxlength="19" />		    <span class="style75">will be deleted</span></pre>
          <pre>

<span class="style71">Username:	</span><input name="Username" type="text" size="30" maxlength="10" id="Username" />	<span class="style71">Password:</span>	<input name="Password" type="password" size="25" maxlength="10" id="Password" />	 	<span class="style75">      automatically!!!</span></pre>
        </div>
      </div>
        <div align="left">
        <pre><span class="style75">   

By submitting this form you agree to accept all <a href="terms and conditions.html" target="_new">Terms and Conditions</a></span> 				         	       <input name="Submit" type="submit" id="button" onclick="this.form.post" value="Submit" /></pre>
      </div>
    </form></th>

something else came up

 

<input name="Full_Name" type="text" id="Full_Name" size="50" maxlength="19" <?php if (isset($_POST['Full_Name'])) { echo 'value="'.$_POST['Full_Name'].'"'; } ?>/>

 

This is working fine just in my register page i see the /> after my textfield.

 

Any ideas what to fix?

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.