passing variables between PHP scripts

I would very much appreciate it if someone could help be out. I have been battling to get some seemingly simple php code to work and have had no joy. I have a script that creates a list of categories and each element of this list is a link to the next script but depending on which one you click on varies the value of a variable that is passed over to this second script. This variable is then key in getting the next page to display the right info. I am pretty sure the variable gets asigned a value as it comes up at the bottom of the window,
like so nextscript.php?catid=1 but it doesn't get across to the next script! Even if i put a simple print in at the top of the script to print $catid it prints nothing let alone work as it is supposed to in the rest of the code.

I'm sure there's a simple answer and i would be very greatfull if someone would give it to me!



  • ----------- SCRIPT_1.PHP ------------
    echo '<a href="SCRIPT_2.PHP">No Category';
    echo 'Category 1';
    echo 'Category 2';
    echo 'Category 3';

    ----------- SCRIPT_2.PHP ------------
    if (! isset($catid) ){
    echo 'You didn't selecte any category';
    echo 'You selected the category '.$catid;

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!


In this Discussion