SitePoint Sponsor

User Tag List

Results 1 to 8 of 8
  1. #1
    SitePoint Guru mmarif4u's Avatar
    Join Date
    Dec 2006
    Location
    /dev/swat
    Posts
    619
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    $_GET with continues pages

    Hi guys.
    I have page from where i get the package number and send it to the url.
    My url now look like this.
    "http://localhost/home/user.php?package=1006"

    Now in this user.php page the user fill the form , after this he submit the form.
    So it go to next page then fill another form there and go to next(last) page.
    So what i want is how i set the url to sent and get information rom page.

    In user.php coding if user fill form he rediected to next page.
    I use header fro that.
    But how to modify that header to go next page while the info is sn\ent through url.
    PHP Code:
    header("location:forms/form1.php"); 
    I want to do it like this:
    PHP Code:
    header("location:user.php?$_GET['package']&$_GET['pack']"); 
    but i am stuck with this.
    How could i do this.
    Thanks.

  2. #2
    Certified Ethical Hacker silver trophybronze trophy dklynn's Avatar
    Join Date
    Feb 2002
    Location
    Auckland
    Posts
    14,607
    Mentioned
    19 Post(s)
    Tagged
    2 Thread(s)
    mm,

    I've done something similar but used $_POST and a form with hidden fields and a SUBMIT button which the visitor must click to progress. Of course, you could use SESSIONs, too, to bring the data along.

    Regards,

    DK
    David K. Lynn - Data Koncepts is a long-time WebHostingBuzz (US/UK)
    Client and (unpaid) WHB Ambassador
    mod_rewrite Tutorial Article (setup, config, test & write
    mod_rewrite regex w/sample code) and Code Generator

  3. #3
    SitePoint Guru mmarif4u's Avatar
    Join Date
    Dec 2006
    Location
    /dev/swat
    Posts
    619
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks for ur reply.

    How can u give me an example of that.

  4. #4
    Dinah-Moe Humm mudshark's Avatar
    Join Date
    Dec 2003
    Posts
    1,072
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    PHP Code:
    header("Location: http://example.com/user.php?package=".$_GET['package']."&pack=".$_GET['pack']); 

  5. #5
    SitePoint Guru mmarif4u's Avatar
    Join Date
    Dec 2006
    Location
    /dev/swat
    Posts
    619
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks for ur reply...
    1 question more ?
    What will be the content of next page:
    Is it ok:
    PHP Code:
    <?php
    ob_start
    ();
    session_start();
    $_GET['pack'];
    $_SESSION[$_GET['pack']];
    include(
    'forms/form.php');
    ?>
    Thanks...

  6. #6
    Dinah-Moe Humm mudshark's Avatar
    Join Date
    Dec 2003
    Posts
    1,072
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    PHP Code:
    <?php 
    ob_start
    (); 
    session_start(); 
    $pack $_GET['pack']; 
    $_SESSION['pack'] = $pack
    include(
    'forms/form.php'); 
    ?>
    You have to assign variables using the = sign.

  7. #7
    SitePoint Guru mmarif4u's Avatar
    Join Date
    Dec 2006
    Location
    /dev/swat
    Posts
    619
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Ok Let me be more clear:
    This is my 1st page:

    subscribe.php
    PHP Code:
    <?php
    session_start
    ();
    $package=array('1001','1006','1007');
    $package[0]="images/subscribe now.gif";
    $package[1]="images/subscribe now.gif";
    $package[2]="images/subscribe now.gif";
    $_SESSION['1001']=$package[0];
    $_SESSION['1006']=$package[1];
    $_SESSION['1007']=$package[2];

    echo 
    "<table align=\"center\" >";
    echo 
    "<tr>";
    echo 
    "<td align=\"center\" ><img src=\"images/logo1.jpg\"></img></td>";

    echo 
    "</tr>";
    echo 
    "<tr>";
    echo 
    "<td align=\"center\" ><img src=\"images/home.gif\"></img></td>"

    echo 
    "</tr>";
    echo 
    "</table>";
    echo 
    "<table width=\"73.8%\">";
    echo 
    "<tr>";
    echo 
    "<td width=\"44.5%\">&nbsp;</td>";
    echo 
    "<td align=\"left\" width=\"9.8%\"><a href=\"user.php?package=1001\"><img src=\"{$_SESSION['1001']}\" border=\"0\"></img></a></td>";
    echo 
    "<td align=\"left\" width=\"9.8%\"><a href=\"user.php?package=1006\"><img src=\"{$_SESSION['1006']}\" border=\"0\"></img></a></td>"
    echo 
    "<td align=\"left\" width=\"9.8%\"><a href=\"user.php?package=1007\"><img src=\"{$_SESSION['1007']}\" border=\"0\"></img></a></td>";
    echo 
    "</tr>";
    echo 
    "</table>";

    ?>
    <html><head><title>Subscribe Now</title></head>
    <body >
    </body>
    </html>
    this is my 2nd page.

    user.php
    PHP Code:
    <?php 
    ob_start
    ();
    session_start();
    include(
    "include/db.php");
    include(
    "include/common.php");
    //include("function.php");
    //$ppackage="1002";
    //$_SESSION['1002']=$ppackage;
    $_GET['package'];
    $_SESSION[$_GET['package']];
    if(
    $_GET['package'] == 1006){$package='1006';
     }
    if(
    $_GET['package'] == 1001){$package='1001';
     }
     if(
    $_GET['package'] == 1007){$package='1007';
     }
    //{echo"$package";}
     
    if (!isset($_POST['submitok'])):
        
        
    ?>
    <!DOCTYPE html PUBLIC "-//W3C/DTD XHTML 1.0 Transitional//EN"
      "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <link rel="stylesheet" href="styles/style.css" type="text/css">
    <Script>
    function doubleConfirm()
    {
      if (!confirm('R u sure to post the form.')) return false;
      if (!confirm('Please check again the form for errors.')) return false;
      return true;
    }
    </script>
       <title> New User Registration Form </title>
      <meta http-equiv="Content-Type"
        content="text/html; charset=iso-8859-1>
        
    </head>


    <body bgcolor="#4572da"><center>
    <?php include ("forms/subsform.php")?>
    </body>
    </html>

        <?php 
       
    else:
        
        
    $dbcnx dbConnect('db');
         
    $name=mysql_real_escape_string($_POST['nmanme']);
         
    $custic=mysql_real_escape_string($_POST['nmic']);
     
    ?>
        <?php 
       header
    ("location:user.php?package=".$_GET['package']."&cpackage=".$_GET['1002']);
    exit;

    endif;

    ?>
    This is the 3rd page.

    childform.php
    PHP Code:
    <?php
    ob_start
    ();
    session_start();
    $pack $_GET['pack']; 
    $_SESSION['pack'] = $pack;
    include(
    'forms/form1.php');
    ?>
    So how can i set the urls now...
    That it shuould work properly.
    Thanks.

  8. #8
    SitePoint Guru mmarif4u's Avatar
    Join Date
    Dec 2006
    Location
    /dev/swat
    Posts
    619
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Any suggestion guys...
    Please quick help will be appriciated...


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •