Jump to content

Registration Page


Snooble

Recommended Posts

Hello everyone,

I have a three page registration form that uses fwrite to output the information entered to a text file.

First page consists of a form that posts information to hidden fields on the second page. The second page is supposed to take them hidden fields AND a few new fields and post them to the 3rd registration page. That page is just a confirm button. The confirm button takes all the information and fwrites it.

Here is the 2nd page. and 3rd. What do i change? I believe the first page is working correctly. Thank you


Register 2.

[code]  <div align="center">
            <?php echo $_POST["fname"]; ?> <?php echo $_POST["sname"]; ?>, Welcome To One Time Deals<br />
                  <br />
                  <br /> </div><br />
<?php echo "<form action='final.php' method='post'>
<input type='hidden' value='{$_POST['fname']}'>
<input type='hidden' value='{$_POST['sname']}'>
<input type='hidden' value='{$_POST['pass']}'>
<input type='hidden' value='{$_POST['passtwo']}'>
<input type='hidden' value='{$_POST['llno']}'>
<input type='hidden' value='{$_POST['mobno']}'>
<input type='hidden' value='{$_POST['addno']}'>
<input type='hidden' value='{$_POST['addone']}'>
<input type='hidden' value='{$_POST['addtwo']}'>
<input type='hidden' value='{$_POST['addthree']}'>
<input type='hidden' value='{$_POST['city']}'>
<input type='hidden' value='{$_POST['other']}'>
<input type='hidden' value='{$_POST['country']}'>
<input type='text' name='orderamount'>
  <input type='submit' name='submit'>
</form>";?>[/code]


Register 3

[code] <?php 
echo "<form action='index.php' method='post'>
<input type='hidden' value='{$_POST['fname']}'>
<input type='hidden' value='{$_POST['sname']}'>
<input type='hidden' value='{$_POST['pass']}'>
<input type='hidden' value='{$_POST['passtwo']}'>
<input type='hidden' value='{$_POST['llno']}'>
<input type='hidden' value='{$_POST['mobno']}'>
<input type='hidden' value='{$_POST['addno']}'>
<input type='hidden' value='{$_POST['addone']}'>
<input type='hidden' value='{$_POST['addtwo']}'>
<input type='hidden' value='{$_POST['addthree']}'>
<input type='hidden' value='{$_POST['city']}'>
<input type='hidden' value='{$_POST['other']}'>
<input type='hidden' value='{$_POST['country']}'>
<input type='text' name='orderamount'>
  <input type='submit' name='submit'>
</form>";
if (isset($_POST['submit'])) {
$pass = $_POST['pass'];
$email = $_POST['email'];
$passtwo = $_POST['passtwo'];
$fname = $_POST['fname'];
$sname = $_POST['sname'];
$llno = $_POST['llno'];
$mobno = $_POST['mobno'];
$addno = $_POST['addno'];
$addone = $_POST['addone'];
$addtwo = $_POST['addtwo'];
$addthree = $_POST['addthree'];
$city = $_POST['city'];
$postcode = $_POST['postcode'];
$other = $_POST['other'];
$title = $_POST['title'];
$country = $_POST['country'];
$date = date("g:i a");
$submit = $_POST['submit'];
$fp = fopen('1.txt', 'a+');
fwrite($fp, "Time: ".$date."\nEmail: ".$email."\nPass: ".$pass."\nPass Confirm: ".$passtwo."\nFirst Name: ".$fname."\nSurname: ".$sname."\nLL Number: ".$llno."\nMob: ".$mobno."\nHouse No/Name: ".$addno."\nAddress line 1: ".$addone."\nAddress line 2: ".$addtwo."\nAddress Line 3: ".$addthree."\nCity/Town: ".$city."\nPost Code: ".$postcode. "\nCountry, Other: ".$other."\nTitle :".$title."\nCountry: ".$country."\n\n");
fclose($fp);
  } ?>[/code]


Thank you in advance

Snooble
Link to comment
https://forums.phpfreaks.com/topic/35377-registration-page/
Share on other sites

The text file looks like this:

[code]Time: 10:22 am
Email:
Pass:
Pass Confirm:
First Name:
Surname:
LL Number:
Mob:
House No/Name:
Address line 1:
Address line 2:
Address Line 3:
City/Town:
Post Code:
Country, Other:
Title :
Country:
[/code]

So it obviously doesn't get the variables through.

That's all i know.

Snooble
Link to comment
https://forums.phpfreaks.com/topic/35377-registration-page/#findComment-167216
Share on other sites

Ok, in the 2nd and 3rd pages you need to add the 'name' attribute to the fields.

If you have 'globals' turned on use this method:

<input type='hidden' name='username' value='<?php echo $username;?>'>

If turned off then this method:

<input type='hidden' name='username' value='<?php echo $_POST['username'];?>'>
Link to comment
https://forums.phpfreaks.com/topic/35377-registration-page/#findComment-167243
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.