aceishigh Posted May 21, 2006 Share Posted May 21, 2006 Hey, I have a real simple problem, I have a 3 page process which puts data into 3 seperate MySQL tables and I create an ID on the first and wish to just pass this over to the second page. How do you pass over data from one page to the next? Quote Link to comment https://forums.phpfreaks.com/topic/10126-simple-php-help-needed/ Share on other sites More sharing options...
.josh Posted May 21, 2006 Share Posted May 21, 2006 do a hidden input in your form with the value you want to pass. or start a session and pass your variable through a session. Quote Link to comment https://forums.phpfreaks.com/topic/10126-simple-php-help-needed/#findComment-37706 Share on other sites More sharing options...
aceishigh Posted May 21, 2006 Author Share Posted May 21, 2006 [!--quoteo(post=375787:date=May 21 2006, 10:47 AM:name=Crayon Violent)--][div class=\'quotetop\']QUOTE(Crayon Violent @ May 21 2006, 10:47 AM) [snapback]375787[/snapback][/div][div class=\'quotemain\'][!--quotec--]do a hidden input in your form with the value you want to pass. or start a session and pass your variable through a session.[/quote]Hey thanks for the quick reply, maybe I should have been a little more specific :S ok, I don't think I can add a hidden input field because I am using a php generated random number and storing this as a business ID in one table. On the second page I want to add this businessID to a seperate table so they can be linked. So I wanted to post my $businessID field to the next page so this can be inserted into the table. So can you post businessID from page 1 to page2? I'm really stumped, I have thought long and hard about this think logically this is the best way of doing what I need. Quote Link to comment https://forums.phpfreaks.com/topic/10126-simple-php-help-needed/#findComment-37707 Share on other sites More sharing options...
.josh Posted May 21, 2006 Share Posted May 21, 2006 how are you moving from page 1 to page 2? Quote Link to comment https://forums.phpfreaks.com/topic/10126-simple-php-help-needed/#findComment-37720 Share on other sites More sharing options...
Julian Posted May 23, 2006 Share Posted May 23, 2006 [!--quoteo(post=375804:date=May 21 2006, 11:09 AM:name=Crayon Violent)--][div class=\'quotetop\']QUOTE(Crayon Violent @ May 21 2006, 11:09 AM) [snapback]375804[/snapback][/div][div class=\'quotemain\'][!--quotec--]how are you moving from page 1 to page 2?[/quote]Hi, I'm having the same problem. Here's what I'm doing: First Page includes data using a form. When I click submit I need to pass the ?id= variable in order to get the second form on the second page working with the id.$insertGoTo = "Players_Include.php"; if (isset($_SERVER['QUERY_STRING'])) { $insertGoTo .= (strpos($insertGoTo, '?')) ? "&" : "?"; $insertGoTo .= $_SERVER['QUERY_STRING']; } header(sprintf("Location: %s", $insertGoTo));}Thanks Quote Link to comment https://forums.phpfreaks.com/topic/10126-simple-php-help-needed/#findComment-38302 Share on other sites More sharing options...
Barand Posted May 23, 2006 Share Posted May 23, 2006 Structure like this::page1.php::[code]<FORM action='page2.php'> <fields for form 1></FORM>[/code]::page2.php::[code]<?php process form 1 data insert record get $newid ?> <FORM action='page3.php'> <hidden field name='newid' value='$newid> <fields for form 2> </FORM>[/code]etc Quote Link to comment https://forums.phpfreaks.com/topic/10126-simple-php-help-needed/#findComment-38347 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.