recieving variables from POST and GET issues. Please help

Hi all,

I tried to post this earlier but there was an error so if it appears twice please forgive me.

I have a page that recieves two variables from two different palges.

One via a form so:

$discussIDpost =(int)$_POST[‘discussID’];

And the other via:

header(“location:forumsDiscussion.php?$comDiscussNo”);

So:

$discussIDtrans = $_GET[‘comDiscussNo’];

I then have the folowing if statment:

if (empty($discussIDtrans)){
$discussID = $discussIDpost;
}

else {
$discussID = $discussIDtrans;
}

$sql = “SELECT * FROM discussion WHERE discussID =’$discussID’”;

*ETC ETC ETC

The post part works fine but not the get.

in fact when i alert or echo $discussIDtrans it is blank, even though there is a number in the URL.

Can anyone help me out?

Thanks

You need to modify this your line:
[php]header(“location:forumsDiscussion.php?$comDiscussNo”);
[/php]

so that it looks like this:
[php]header(“location:forumsDiscussion.php?comDiscussNo=$comDiscussNo”);
[/php]

Sponsor our Newsletter | Privacy Policy | Terms of Service