Snooble Posted January 23, 2007 Share Posted January 23, 2007 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 youRegister 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 advanceSnooble Quote Link to comment https://forums.phpfreaks.com/topic/35377-registration-page/ Share on other sites More sharing options...
simcoweb Posted January 23, 2007 Share Posted January 23, 2007 Are you getting a specific error? Quote Link to comment https://forums.phpfreaks.com/topic/35377-registration-page/#findComment-167213 Share on other sites More sharing options...
Snooble Posted January 23, 2007 Author Share Posted January 23, 2007 The text file looks like this:[code]Time: 10:22 amEmail: 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 Quote Link to comment https://forums.phpfreaks.com/topic/35377-registration-page/#findComment-167216 Share on other sites More sharing options...
simcoweb Posted January 23, 2007 Share Posted January 23, 2007 After step one when they get to step two are these two variables getting populated? <?php echo $_POST["fname"]; ?> <?php echo $_POST["sname"]; ?>, Welcome To One Time Deals<br /> Quote Link to comment https://forums.phpfreaks.com/topic/35377-registration-page/#findComment-167233 Share on other sites More sharing options...
Snooble Posted January 23, 2007 Author Share Posted January 23, 2007 yes :) sorry should have said. It will say "Welcome sally blahblah" etc.But i dont get anything fwrited. So i assume the second page needs tweaking.Snooble Quote Link to comment https://forums.phpfreaks.com/topic/35377-registration-page/#findComment-167235 Share on other sites More sharing options...
simcoweb Posted January 23, 2007 Share Posted January 23, 2007 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'];?>'> Quote Link to comment https://forums.phpfreaks.com/topic/35377-registration-page/#findComment-167243 Share on other sites More sharing options...
Snooble Posted January 23, 2007 Author Share Posted January 23, 2007 Hmmm Globals? It's hosted at www.ifastnet.com.I will try both, will this fix the problem? As i use the same hidden field output in the first registration page.Snooble Quote Link to comment https://forums.phpfreaks.com/topic/35377-registration-page/#findComment-167249 Share on other sites More sharing options...
Snooble Posted January 23, 2007 Author Share Posted January 23, 2007 worked beautifully! I had doubts too!Thank you ever so much! So i need to include the names so i can reuse the variables. Thats brilliant.Thank you very much.*SOLVED :D*Snooble Quote Link to comment https://forums.phpfreaks.com/topic/35377-registration-page/#findComment-167257 Share on other sites More sharing options...
simcoweb Posted January 23, 2007 Share Posted January 23, 2007 Groovy.. good luck! Quote Link to comment https://forums.phpfreaks.com/topic/35377-registration-page/#findComment-167259 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.