how to get values on next page using get method

Discussion in 'PHP' started by mohsin, Mar 29, 2006.

  1. #1
    Hi all,
    I want to get values from one page to the next using the get method.
    but I am not getting it.
    <td><a href="Details.php?use=<?php $user ?>"><?php echo "$album" ;?></a></td>
    as i click on the value that will be displayed by the $album variabl(php), i wan to get the value in use,from php variable which has value in it on the top of the page.
    plz help me as soon as possible.
    thnxx to all;
    bye
     
    mohsin, Mar 29, 2006 IP
  2. daboss

    daboss Guest

    Messages:
    2,249
    Likes Received:
    151
    Best Answers:
    0
    Trophy Points:
    0
    #2
    let me try...

    page A (html file) has a link:
    <td><td><a href="details.php?user=<?php echo $user; ?>&album=<?php echo $album; ?>">Link Text</a></td>

    when the link is clicked, it goes to details.php. within details.php, use $_GET['user'] and $_GET['album'] to access the data passed from page A...
     
    daboss, Mar 29, 2006 IP
  3. nemik

    nemik Peon

    Messages:
    14
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    exactly. also know that GET requests have certain size limitations and for bigger files or sensetive info that shouldn't be in the URL you should use POST instead. Though it cannot be sent over a URL so easily.

    also, to keep some variables such as a username throughout the site you could do start_session(); and then store and get variables from $_SESSION
     
    nemik, Mar 29, 2006 IP
  4. Psychotomus

    Psychotomus Guest

    Messages:
    427
    Likes Received:
    8
    Best Answers:
    0
    Trophy Points:
    0
    #4
    its actually session_start();
     
    Psychotomus, Mar 30, 2006 IP