Get/POst method not working

hi, I have a get method <?php echo $_GET['submission_id']; ?> It
worked just fine on my host, bu then It wont work on a server at
1and1. What is wrong? Is there a different way that i can have it
display the variable? or What syntax for a php.ini file would allow it
to work. thanks josh
macsaregreat [ Sa, 09 Juni 2007 20:16 ] [ ID #1734109 ]

Re: Get/POst method not working

macsaregreat [at] gmail.com wrote:
> hi, I have a get method <?php echo $_GET['submission_id']; ?> It
> worked just fine on my host, bu then It wont work on a server at
> 1and1.

As we don't know what version of php the later one uses, we can't for sure say
what's wrong, but it could be that you aren't using the get method, but post,
in which case you should have used $_POST, but when unsure how a page will be
called on and you aren't that picky about the moethod, then use $_REQUEST.

If they use an old version of php (pre 4.1.0), then use $HTTP_GET_VARS and/or
$HTTP_POST_VARS. Keep in mind that those won't work well on newer versions of php.

--

//Aho
Shion [ Sa, 09 Juni 2007 20:26 ] [ ID #1734110 ]

Re: Get/POst method not working

O sorry, forgot about that, version PHP Version 4.4.7
I did try Post method, and $HTTP_GET_VARS
<?php $submission_id=$HTTP_POST_VARS['submission_id'];
echo($submission_id . "<BR>"); ?>

ill try the $_REQUEST. to see what happens

On Jun 9, 2:26 pm, "J.O. Aho" <u... [at] example.net> wrote:
> macsaregr... [at] gmail.com wrote:
> > hi, I have a get method <?php echo $_GET['submission_id']; ?> It
> > worked just fine on my host, bu then It wont work on a server at
> > 1and1.
>
> As we don't know what version of php the later one uses, we can't for sure say
> what's wrong, but it could be that you aren't using the get method, but post,
> in which case you should have used $_POST, but when unsure how a page will be
> called on and you aren't that picky about the moethod, then use $_REQUEST.
>
> If they use an old version of php (pre 4.1.0), then use $HTTP_GET_VARS and/or
> $HTTP_POST_VARS. Keep in mind that those won't work well on newer versions of php.
>
> --
>
> //Aho
macsaregreat [ Sa, 09 Juni 2007 20:34 ] [ ID #1734111 ]

Re: Get/POst method not working

O,THANK YOU so much ^_^ it works with the
<?php

echo $_REQUEST['submission_id'];

import_request_variables('p', 'p_');
echo $p_submission_id;?>

What is the difference between the two that allow this one to work and
not the other?

Thanks
Josh

On Jun 9, 2:34 pm, macsaregr... [at] gmail.com wrote:
> O sorry, forgot about that, version PHP Version 4.4.7
> I did try Post method, and $HTTP_GET_VARS
> <?php $submission_id=$HTTP_POST_VARS['submission_id'];
> echo($submission_id . "<BR>"); ?>
>
> ill try the $_REQUEST. to see what happens
>
> On Jun 9, 2:26 pm, "J.O. Aho" <u... [at] example.net> wrote:
>
> > macsaregr... [at] gmail.com wrote:
> > > hi, I have a get method <?php echo $_GET['submission_id']; ?> It
> > > worked just fine on my host, bu then It wont work on a server at
> > > 1and1.
>
> > As we don't know what version of php the later one uses, we can't for sure say
> > what's wrong, but it could be that you aren't using the get method, but post,
> > in which case you should have used $_POST, but when unsure how a page will be
> > called on and you aren't that picky about the moethod, then use $_REQUEST.
>
> > If they use an old version of php (pre 4.1.0), then use $HTTP_GET_VARS and/or
> > $HTTP_POST_VARS. Keep in mind that those won't work well on newer versions of php.
>
> > --
>
> > //Aho
macsaregreat [ Sa, 09 Juni 2007 20:42 ] [ ID #1734112 ]

Re: Get/POst method not working

macsaregreat [at] gmail.com wrote:
> O,THANK YOU so much ^_^ it works with the
> <?php
>
> echo $_REQUEST['submission_id'];
>
> import_request_variables('p', 'p_');
> echo $p_submission_id;?>
>
> What is the difference between the two that allow this one to work and
> not the other?

There isn't any magic behind the use of $_REQUEST, it's just the array where
you put together the $_POST, $_GET and $_COOKIE array, kind of

$_REQUEST = array_merge($_POST,$_GET,$_COOKIE)


--

//Aho
Shion [ Sa, 09 Juni 2007 21:05 ] [ ID #1734113 ]

Re: Get/POst method not working

Post removed (X-No-Archive: yes)
Notifier Deamon [ Mo, 11 Juni 2007 20:31 ] [ ID #1735157 ]

Re: Get/POst method not working

On Sat, 09 Jun 2007 21:05:05 +0200, J.O. Aho <user [at] example.net> wrote:

> macsaregreat [at] gmail.com wrote:
>> O,THANK YOU so much ^_^ it works with the
>> <?php
>>
>> echo $_REQUEST['submission_id'];
>>
>> import_request_variables('p', 'p_');
>> echo $p_submission_id;?>
>>
>> What is the difference between the two that allow this one to work an=
d
>> not the other?
>
> There isn't any magic behind the use of $_REQUEST, it's just the array=
=

> where
> you put together the $_POST, $_GET and $_COOKIE array, kind of
>
> $_REQUEST =3D array_merge($_POST,$_GET,$_COOKIE)

To elaborate on that: The possible $_SESSION is in there too, and it wil=
l =

merge the respective arrays according to variables_order, which normally=
=

is GPCS (GET, POST, COOKIE, SESSION). The latter will overwrite the =

earlier.
-- =

Rik Wasmus
luiheidsgoeroe [ Sa, 16 Juni 2007 14:50 ] [ ID #1739916 ]
PHP » alt.php » Get/POst method not working

Vorheriges Thema: Redirecting URL ID's using PHP
Nächstes Thema: joining multiple jpg images