RE: [PHP] if not $_POST,not $_GET not $_REQUEST...what is it?
| From: | Greg Wiley | Date: | Fri, 02 May 2003 18:51:21 +0000 |
| Subject: | RE: [PHP] if not $_POST,not $_GET not $_REQUEST...what is it? | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-146175@lists.php.net to get a copy of this message | ||
Ryan A wrote:
> Hi,
> I am getting some values from 2checkout...I wanted to know in
> what form so I made this simple little test script...
>
> <?
> if($_POST[$product_id] >=3 && $_POST[$product_id] <=8)
>
> {print("post is true");}
>
> elseif($_GET[$product_id] >=3 && $_GET[$product_id] <=8)
>
> {print("GET is true");}
>
> elseif($_REQUEST[$product_id] >=3 && $_REQUEST[$product_id] <=8)
>
> {print("request is true");}
> else
> {echo 'None worked';}
>>
>
> The $product_id that I am passing is 6 but I always get the
> message "None worked"....What should I do? what else is there?
>
Remove the '$' character from the $_POST, $_GET and $_REQUEST array indices,
e.g.
$_GET[$product_id] should be $_GET['product_id'].
Cheers, Greg.