Results 1 to 3 of 3
  1. #1
    Join Date
    Apr 2003
    Location
    Belgium
    Posts
    23

    Unanswered: a variable after a HTTP_GET_VARS

    Hi,

    I'm having trouble with my variables.
    situation:
    3 pages:

    1.

    Page with a dynamic list (with countries), which are a link to the second page

    2.

    page shows the companies from the choosen country with his address etc.
    You can update a company by clicking on update behind the company of your choice

    3.

    Update-page:
    Here you can change the address etc., after you change, you click update and go back to page 2, where you can see the updated list with companies.


    Problem:


    After you click on a country on page 1, you are linked to the second page with the following code:
    Code:
    <a href="licentieseu.php?%20Name=<?php echo $row_Rspoland ['Name'];?>"><?php echo $row_Rspoland['Name']; ?></a>
    On the second page you're gonna use 'Name' and put it in a variable tempcomp:

    Code:
    <?php 
    session_start();
      $tempcomp = $HTTP_GET_VARS['Name'];
      session_register("tempcomp");
    ?>
    on the third page everything works fine, but when you pust the update-button, and go back tot the second page, the page remains empty en tempcomp doesn't have a value anymore


    What can I do so that tempcomp keeps his value ?


    Thanks !!!!!!!!!
    You help me, and I'll try to help you

  2. #2
    Join Date
    Feb 2004
    Posts
    29
    Code:
    <a href="licentieseu.php?%20Name=<?php echo $row_Rspoland ['Name'];?>"><?php echo $row_Rspoland['Name']; ?></a>
    I will do this as

    $con=$row_Rspoland['name'];
    <a href="licentieseu.php?Name=$con">$con</a>

    on the second page,
    Code:
    session_start();
    $tempcomp=$_GET['Name'];
    session_register("tempcomp")
    The good way for use of global variable on many pages is you can print the values temporarily.
    hope this will help
    Last edited by poppy_123; 06-04-04 at 01:01.

  3. #3
    Join Date
    Jan 2004
    Location
    India
    Posts
    168
    I think you have to do check in the second page for the variable 'Name' as this is loaded twice.
    session_start();
    $tempcon=$HTTP_GET_VARS['Name'];
    if(!$tempcon)
    {
    $tempcon=$_SESSION['tempcon'];
    }
    else
    {
    session_register('tempcon')
    }

    Try this ... am not sure is this what you want..
    Regards

    Rajesh

Posting Permissions

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