Jump to content

Simple PHP help needed!


aceishigh

Recommended Posts

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?
Link to comment
Share on other sites

[!--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.
Link to comment
Share on other sites

[!--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
Link to comment
Share on other sites

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
Link to comment
Share on other sites

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.