473,847 Members | 1,534 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

problems with POST

Hi,

The script below *used* to work. I have only just set up a
server, PHP etc again on my Win98 system and now it doesn't?

On first loading this page, you would have

$p =

and the button image below it.
On clicking the button the same page would reload but pass the hidden values
(r=w & p=f)
so that the first line of the page would then have

$p = f

This no longer works???

<?php
echo "<html><bod y>";
echo "\$p = $p<br><br>"; //###
$str = <<<HTM
<head>
</head>
<body>
<form action="" method="post">
<input type="hidden" name="r" value="w">
<input type="hidden" name="p" value="f">
<input type="image" src="http://home/images/faq-up.gif" border="0"
height="22" width="77">
</form>
</body>
</html>
HTM;
echo $str;
?>
on printing the $_ENV variables along with the the above script I find the
following :

QUERY_METHOD POST
REQUEST_METHOD POST
FORM_P f
FORM_R w

Is there something I haven't enabled in my
setup of PHP that is stopping this from working now?

Or has something changed with PHP, so that I have to do this another way?

many thanks

mori

Nov 27 '05
24 2897
> <?php
echo "<html><bod y>";
echo "\$p = $p<br><br>"; //###
Use $_POST or $HTTP_POST_VARS as others have suggested ($_POST
is preferred, $HTTP_POST_VARS only if $_POST does not work, which
means that you have OLD version of PHP).
$str = <<<HTM
<head>
</head>
<body>
<form action="" method="post">
Give some value to the "action" attribute. Using empty "action"
works differently in different browser. Your browser probably
does not send the data in this case.
<input type="hidden" name="r" value="w">
<input type="hidden" name="p" value="f">
<input type="image" src="http://home/images/faq-up.gif" border="0"
height="22" width="77">
</form>
</body>
</html>
HTM;
echo $str;
Why are you building HTML this way just to echo it?
?>
on printing the $_ENV variables along with the the above script I find the
following :

QUERY_METHOD POST
REQUEST_METHOD POST
FORM_P f
FORM_R w

Is there something I haven't enabled in my
setup of PHP that is stopping this from working now?

Or has something changed with PHP, so that I have to do this another way?


Try this:

<html>
<head>
</head>
<body>
<pre>
$_POST <?php print_r( $_POST ); ?>
$HTTP_POST_VARS <?php print_r( $HTTP_POST_VARS ); ?>
</pre>
<form action="<?php echo htmlspecialchar s( $_SERVER['PHP_SELF'] ); ?>" method="post">
<input type="hidden" name="r" value="w" />
<input type="hidden" name="p" value="f" />
<input type="image" src="http://home/images/faq-up.gif" border="0"
height="22" width="77" />
</form>
</body>
</html>
And check HTML source which gets generated before and after submiting
the form. If it still does not work (does not output the posted values),
then send what you got to this thread.
Hilarion
Nov 28 '05 #11
"Wolfgang Forstmeier" <wo************ *****@gmx.de> wrote in message
news:dm******** **@news.mch.sbs .de...


moriman wrote:
"Juliette" <jr*********@jo keaday.net> wrote in message
news:43******** *************** @news.wanadoo.n l...
moriman wrote:
wow, thx for the *very* quick reply ;-)

tried changing the
echo "\$p = $p<br><br>";

to

echo "\$p = " . $_POST['p'] . "<br><br>";

but still not working :(

mori

"Gordon Burditt" <go***********@ burditt.org> wrote in message
news:11******** *****@corp.supe rnews.com...

>> The script below *used* to work. I have only just set up a
>> server, PHP etc again on my Win98 system and now it doesn't?
> A variable passed from HTML by the POST method is $_POST['r'] or
> $_POST['p'], *not* $r or $p. (Also see $_GET for variables
> passed by the GET method). Fix your script. Do not turn
> on "register_globa ls".
>
> Gordon L. Burditt
>
>
>
>> On first loading this page, you would have
>>
>> $p =
>>
>> and the button image below it.
>> On clicking the button the same page would reload but pass the hidden values

>> (r=w & p=f)
>> so that the first line of the page would then have
>>
>> $p = f
>>
>> This no longer works???
>>
>> <?php
>> echo "<html><bod y>";
>> echo "\$p = $p<br><br>"; //###
>> $str = <<<HTM
>> <head>
>> </head>
>> <body>
>> <form action="" method="post">
>> <input type="hidden" name="r" value="w">
>> <input type="hidden" name="p" value="f">
>> <input type="image" src="http://home/images/faq-up.gif" border="0"
>> height="22" width="77">
>> </form>
>> </body>
>> </html>
>> HTM;
>> echo $str;
>> ?>
>>
>>
>> on printing the $_ENV variables along with the the above script I find the

>> following :
>>
>> QUERY_METHOD POST
>> REQUEST_METHOD POST
>> FORM_P f
>> FORM_R w
>>
>> Is there something I haven't enabled in my
>> setup of PHP that is stopping this from working now?
>>
>> Or has something changed with PHP, so that I have to do this another

way?
>> many thanks
>>
>> mori
>>
>>
>>
>

Try:

echo "\$p = " . $HTTP_POST_VARS['p'] . "<br><br>";


nope, doesn't work either :(


This will work, you have to set up an submit button
(javascript or nativ html to send your form data)

If you would like to have an image you should prefer JavaScript.
If a simple HTML - Button is enougth try the simple Submit Button like
in my example.
Have Fun...

<?php
echo "<html>";
echo "\$p = ".$_POST['p']."<br><br>"; //###
$str = <<<HTM
<head>
</head>
<body>
<form action="" method="post">
<input type="hidden" name="r" value="w">
<input type="hidden" name="p" value="f">
<input type="submit">
</form>
</body>
</html>
HTM;
echo $str;
?>


Did you try this wolfgang? I did and it doesn't work for me¿
Nov 28 '05 #12
"vdP" <hv************ **@wanadoo.nl> wrote in message
news:43******** *************** @news.wanadoo.n l...
Jerry Stuckle wrote:
moriman wrote:
<form action="" method="post">
<input type="hidden" name="r" value="w">
<input type="hidden" name="p" value="f">
<input type="image" src="http://home/images/faq-up.gif" border="0"
height="22" width="77">
</form>

How are you submitting your form? I don't see a submit button, for
instance.

I thought the same till I looked up the HTML-specification at
http://www.w3.org/TR/REC-html40/inte...ms.html#h-17.4
Apparently the input of image type serves as a submit button.

vdP


Yes, that's correct, the image acts as the submit button ;-)
Nov 28 '05 #13

"Hilarion" <hi******@SPAM. op.SMIECI.pl> wrote in message
news:dm******** **@news.onet.pl ...
<?php
echo "<html><bod y>";
echo "\$p = $p<br><br>"; //###
Use $_POST or $HTTP_POST_VARS as others have suggested ($_POST
is preferred, $HTTP_POST_VARS only if $_POST does not work, which
means that you have OLD version of PHP).
$str = <<<HTM
<head>
</head>
<body>
<form action="" method="post">


Give some value to the "action" attribute. Using empty "action"
works differently in different browser. Your browser probably
does not send the data in this case.


action="" posts the data to the file\page that is loaded.
As you will also see from the OP, the data *is* being sent
on printing the $_ENV variables along with the the above script I find the following :

QUERY_METHOD POST
REQUEST_METHOD POST
FORM_P f
FORM_R w
the FORM_P f and FORM_R w are the data that have been received. Only I can't
seem to 'get hold' of them.
<input type="hidden" name="r" value="w">
<input type="hidden" name="p" value="f">
<input type="image" src="http://home/images/faq-up.gif" border="0"
height="22" width="77">
</form>
</body>
</html>
HTM;
echo $str;


Why are you building HTML this way just to echo it?
?>
on printing the $_ENV variables along with the the above script I find the following :

QUERY_METHOD POST
REQUEST_METHOD POST
FORM_P f
FORM_R w

Is there something I haven't enabled in my
setup of PHP that is stopping this from working now?

Or has something changed with PHP, so that I have to do this another

way?
Try this:

<html>
<head>
</head>
<body>
<pre>
$_POST <?php print_r( $_POST ); ?>
$HTTP_POST_VARS <?php print_r( $HTTP_POST_VARS ); ?>
</pre>
<form action="<?php echo htmlspecialchar s( $_SERVER['PHP_SELF'] ); ?>" method="post"> <input type="hidden" name="r" value="w" />
<input type="hidden" name="p" value="f" />
<input type="image" src="http://home/images/faq-up.gif" border="0"
height="22" width="77" />
</form>
</body>
</html>
And check HTML source which gets generated before and after submiting
the form. If it still does not work (does not output the posted values),
then send what you got to this thread.

There is some problem with your above action as it sends the post to

http://home/public_html/test.php
not
http://home/test.php

the absolute path to the script is C:/XITAMI-25/APP/public_html/test.php
where C:/XITAMI-25/APP/public_html/ is analogous to my server's http://home

I have also added the following to my script

foreach ($_POST as $key => $value) {echo "{$key}={$value }<br>";}

and this doesn't print anything. Very strange. How can I get

FORM_P f
FORM_R w

yet $_POST appears to be empty¿

The further I go, the less I know

Hilarion


Nov 28 '05 #14


moriman wrote:
"Wolfgang Forstmeier" <wo************ *****@gmx.de> wrote in message
news:dm******** **@news.mch.sbs .de...

moriman wrote:
"Juliette" <jr*********@jo keaday.net> wrote in message
news:43***** *************** ***@news.wanado o.nl...

moriman wrote:

>wow, thx for the *very* quick reply ;-)
>
>tried changing the
>echo "\$p = $p<br><br>";
>
>to
>
>echo "\$p = " . $_POST['p'] . "<br><br>";
>
>but still not working :(
>
>mori
>
>"Gordon Burditt" <go***********@ burditt.org> wrote in message
>news:11*** **********@corp .supernews.com. ..
>
>
>>>The script below *used* to work. I have only just set up a
>>>server , PHP etc again on my Win98 system and now it doesn't?
>>
>>A variable passed from HTML by the POST method is $_POST['r'] or
>>$_POST['p'], *not* $r or $p. (Also see $_GET for variables
>>passed by the GET method). Fix your script. Do not turn
>>on "register_globa ls".
>>
>>Gordon L. Burditt
>>
>>
>>
>>
>>>On first loading this page, you would have
>>>
>>>$p =
>>>
>>>and the button image below it.
>>>On clicking the button the same page would reload but pass the
hidden
values
>
>
>>>(r=w & p=f)
>>>so that the first line of the page would then have
>>>
>>>$p = f
>>>
>>>This no longer works???
>>>
>>><?php
>>>echo "<html><bod y>";
>>>echo "\$p = $p<br><br>"; //###
>>>$str = <<<HTM
>>><head>
>>></head>
>>><body>
>>><form action="" method="post">
>>><input type="hidden" name="r" value="w">
>>><input type="hidden" name="p" value="f">
>>><input type="image" src="http://home/images/faq-up.gif" border="0"
>>>height=" 22" width="77">
>>></form>
>>></body>
>>></html>
>>>HTM;
>>>echo $str;
>>>?>
>>>
>>>
>>>on printing the $_ENV variables along with the the above script I
find
the
>
>
>>>followin g :
>>>
>>>QUERY_ME THOD POST
>>>REQUEST_ METHOD POST
>>>FORM_P f
>>>FORM_R w
>>>
>>>Is there something I haven't enabled in my
>>>setup of PHP that is stopping this from working now?
>>>
>>>Or has something changed with PHP, so that I have to do this another

way?

>>>many thanks
>>>
>>>mori
>>>
>>>
>>>
>>
Try:

echo "\$p = " . $HTTP_POST_VARS['p'] . "<br><br>";

nope, doesn't work either :(


This will work, you have to set up an submit button
(javascript or nativ html to send your form data)

If you would like to have an image you should prefer JavaScript.
If a simple HTML - Button is enougth try the simple Submit Button like
in my example.
Have Fun...

<?php
echo "<html>";
echo "\$p = ".$_POST['p']."<br><br>"; //###
$str = <<<HTM
<head>
</head>
<body>
<form action="" method="post">
<input type="hidden" name="r" value="w">
<input type="hidden" name="p" value="f">
<input type="submit">
</form>
</body>
</html>
HTM;
echo $str;
?>

Did you try this wolfgang? I did and it doesn't work for me�

for me this has worked perfekt ..
Nov 28 '05 #15
"Wolfgang Forstmeier" <wo************ *****@gmx.de> wrote in message
news:dm******** *****@news.t-online.com...


moriman wrote:
"Wolfgang Forstmeier" <wo************ *****@gmx.de> wrote in message
news:dm******** **@news.mch.sbs .de...

moriman wrote:

"Juliette" <jr*********@jo keaday.net> wrote in message
news:43***** *************** ***@news.wanado o.nl...

>moriman wrote:
>
>>wow, thx for the *very* quick reply ;-)
>>
>>tried changing the
>>echo "\$p = $p<br><br>";
>>
>>to
>>
>>echo "\$p = " . $_POST['p'] . "<br><br>";
>>
>>but still not working :(
>>
>>mori
>>
>>"Gordon Burditt" <go***********@ burditt.org> wrote in message
>>news:11*** **********@corp .supernews.com. ..
>>
>>
>>>>The script below *used* to work. I have only just set up a
>>>>server , PHP etc again on my Win98 system and now it doesn't?
>>>
>>>A variable passed from HTML by the POST method is $_POST['r'] or
>>>$_POST['p'], *not* $r or $p. (Also see $_GET for variables
>>>passed by the GET method). Fix your script. Do not turn
>>>on "register_globa ls".
>>>
>>>Gordon L. Burditt
>>>
>>>
>>>
>>>
>>>>On first loading this page, you would have
>>>>
>>>>$p =
>>>>
>>>>and the button image below it.
>>>>On clicking the button the same page would reload but pass the


hidden
>>values
>>
>>
>>>>(r=w & p=f)
>>>>so that the first line of the page would then have
>>>>
>>>>$p = f
>>>>
>>>>This no longer works???
>>>>
>>>><?php
>>>>echo "<html><bod y>";
>>>>echo "\$p = $p<br><br>"; //###
>>>>$str = <<<HTM
>>>><head>
>>>></head>
>>>><body>
>>>><form action="" method="post">
>>>><input type="hidden" name="r" value="w">
>>>><input type="hidden" name="p" value="f">
>>>><input type="image" src="http://home/images/faq-up.gif" border="0"
>>>>height=" 22" width="77">
>>>></form>
>>>></body>
>>>></html>
>>>>HTM;
>>>>echo $str;
>>>>?>
>>>>
>>>>
>>>>on printing the $_ENV variables along with the the above script I


find
>>the
>>
>>
>>>>followin g :
>>>>
>>>>QUERY_ME THOD POST
>>>>REQUEST_ METHOD POST
>>>>FORM_P f
>>>>FORM_R w
>>>>
>>>>Is there something I haven't enabled in my
>>>>setup of PHP that is stopping this from working now?
>>>>
>>>>Or has something changed with PHP, so that I have to do this another
way?

>>>>many thanks
>>>>
>>>>mori
>>>>
>>>>
>>>>
>>>
>Try:
>
>echo "\$p = " . $HTTP_POST_VARS['p'] . "<br><br>";

nope, doesn't work either :(

This will work, you have to set up an submit button
(javascript or nativ html to send your form data)

If you would like to have an image you should prefer JavaScript.
If a simple HTML - Button is enougth try the simple Submit Button like
in my example.
Have Fun...

<?php
echo "<html>";
echo "\$p = ".$_POST['p']."<br><br>"; //###
$str = <<<HTM
<head>
</head>
<body>
<form action="" method="post">
<input type="hidden" name="r" value="w">
<input type="hidden" name="p" value="f">
<input type="submit">
</form>
</body>
</html>
HTM;
echo $str;
?>

Did you try this wolfgang? I did and it doesn't work for me?

for me this has worked perfekt ..


This is where I think the problem lies, in that there may be something in
php.ini (or elsewhere) which isn't enabled that is preventing this working
for me.

Just can't figure out what or where :(

thx
Nov 28 '05 #16
vdP wrote:
Jerry Stuckle wrote:
moriman wrote:
<form action="" method="post">
<input type="hidden" name="r" value="w">
<input type="hidden" name="p" value="f">
<input type="image" src="http://home/images/faq-up.gif" border="0"
height="22" width="77">
</form>

How are you submitting your form? I don't see a submit button, for
instance.

I thought the same till I looked up the HTML-specification at
http://www.w3.org/TR/REC-html40/inte...ms.html#h-17.4
Apparently the input of image type serves as a submit button.

vdP


Ah, you're right. I seldom use images for submit buttons - just my
programming style (and the fact I'm a lousy artist!).

--
=============== ===
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attgl obal.net
=============== ===
Nov 28 '05 #17
moriman wrote:
"Hilarion" <hi******@SPAM. op.SMIECI.pl> wrote in message
news:dm******** **@news.onet.pl ...
<?php
echo "<html><bod y>";
echo "\$p = $p<br><br>"; //###


Use $_POST or $HTTP_POST_VARS as others have suggested ($_POST
is preferred, $HTTP_POST_VARS only if $_POST does not work, which
means that you have OLD version of PHP).

$str = <<<HTM
<head>
</head>
<body>
<form action="" method="post">


Give some value to the "action" attribute. Using empty "action"
works differently in different browser. Your browser probably
does not send the data in this case.

action="" posts the data to the file\page that is loaded.
As you will also see from the OP, the data *is* being sent

on printing the $_ENV variables along with the the above script I find
the
following :

QUERY_METH OD POST
REQUEST_METH OD POST
FORM_P f
FORM_R w

the FORM_P f and FORM_R w are the data that have been received. Only I can't
seem to 'get hold' of them.

<input type="hidden" name="r" value="w">
<input type="hidden" name="p" value="f">
<input type="image" src="http://home/images/faq-up.gif" border="0"
height="22 " width="77">
</form>
</body>
</html>
HTM;
echo $str;


Why are you building HTML this way just to echo it?

?>
on printing the $_ENV variables along with the the above script I find
the
following :

QUERY_METH OD POST
REQUEST_METH OD POST
FORM_P f
FORM_R w

Is there something I haven't enabled in my
setup of PHP that is stopping this from working now?

Or has something changed with PHP, so that I have to do this another


way?
Try this:

<html>
<head>
</head>
<body>
<pre>
$_POST <?php print_r( $_POST ); ?>
$HTTP_POST_VA RS <?php print_r( $HTTP_POST_VARS ); ?>
</pre>
<form action="<?php echo htmlspecialchar s( $_SERVER['PHP_SELF'] ); ?>"


method="post">
<input type="hidden" name="r" value="w" />
<input type="hidden" name="p" value="f" />
<input type="image" src="http://home/images/faq-up.gif" border="0"
height="22" width="77" />
</form>
</body>
</html>
And check HTML source which gets generated before and after submiting
the form. If it still does not work (does not output the posted values),
then send what you got to this thread.


There is some problem with your above action as it sends the post to

http://home/public_html/test.php
not
http://home/test.php

the absolute path to the script is C:/XITAMI-25/APP/public_html/test.php
where C:/XITAMI-25/APP/public_html/ is analogous to my server's http://home

I have also added the following to my script

foreach ($_POST as $key => $value) {echo "{$key}={$value }<br>";}

and this doesn't print anything. Very strange. How can I get

FORM_P f
FORM_R w

yet $_POST appears to be empty¿

The further I go, the less I know
Hilarion



What happens if your

print_r($_POST) ;

Also try it with $_GET and $_REQUEST.
--
=============== ===
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attgl obal.net
=============== ===
Nov 28 '05 #18

"Jerry Stuckle" <js*******@attg lobal.net> wrote in message
news:f-*************** *************** @comcast.com...
moriman wrote:
"Hilarion" <hi******@SPAM. op.SMIECI.pl> wrote in message
news:dm******** **@news.onet.pl ...
<?php
echo "<html><bod y>";
echo "\$p = $p<br><br>"; //###

Use $_POST or $HTTP_POST_VARS as others have suggested ($_POST
is preferred, $HTTP_POST_VARS only if $_POST does not work, which
means that you have OLD version of PHP).
$str = <<<HTM
<head>
</head>
<body>
<form action="" method="post">

Give some value to the "action" attribute. Using empty "action"
works differently in different browser. Your browser probably
does not send the data in this case.
action="" posts the data to the file\page that is loaded.
As you will also see from the OP, the data *is* being sent

on printing the $_ENV variables along with the the above script I find


the
following :

QUERY_METH OD POST
REQUEST_METH OD POST
FORM_P f
FORM_R w

the FORM_P f and FORM_R w are the data that have been received. Only I can't seem to 'get hold' of them.

<input type="hidden" name="r" value="w">
<input type="hidden" name="p" value="f">
<input type="image" src="http://home/images/faq-up.gif" border="0"
height="22 " width="77">
</form>
</body>
</html>
HTM;
echo $str;

Why are you building HTML this way just to echo it?
?>
on printing the $_ENV variables along with the the above script I find


the
following :

QUERY_METH OD POST
REQUEST_METH OD POST
FORM_P f
FORM_R w

Is there something I haven't enabled in my
setup of PHP that is stopping this from working now?

Or has something changed with PHP, so that I have to do this another


way?
Try this:

<html>
<head>
</head>
<body>
<pre>
$_POST <?php print_r( $_POST ); ?>
$HTTP_POST_VA RS <?php print_r( $HTTP_POST_VARS ); ?>
</pre>
<form action="<?php echo htmlspecialchar s( $_SERVER['PHP_SELF'] ); ?>"


method="post">
<input type="hidden" name="r" value="w" />
<input type="hidden" name="p" value="f" />
<input type="image" src="http://home/images/faq-up.gif" border="0"
height="22" width="77" />
</form>
</body>
</html>
And check HTML source which gets generated before and after submiting
the form. If it still does not work (does not output the posted values),
then send what you got to this thread.


There is some problem with your above action as it sends the post to

http://home/public_html/test.php
not
http://home/test.php

the absolute path to the script is C:/XITAMI-25/APP/public_html/test.php
where C:/XITAMI-25/APP/public_html/ is analogous to my server's http://home
I have also added the following to my script

foreach ($_POST as $key => $value) {echo "{$key}={$value }<br>";}

and this doesn't print anything. Very strange. How can I get

FORM_P f
FORM_R w

yet $_POST appears to be empty¿

The further I go, the less I know
Hilarion



What happens if your

print_r($_POST) ;

Also try it with $_GET and $_REQUEST.


all 3 arrays are empty

post <?php print_r($_POST) ; ?><br>
get <?php print_r($_GET); ?><br>
request <?php print_r($_REQUE ST); ?><br>

gives

post Array ( )
get Array ( )
request Array ( )


--
=============== ===
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attgl obal.net
=============== ===


Nov 28 '05 #19

"moriman" <mo*****@btinte rnet.com> wrote in message
news:dm******** **@nwrdmz01.dmz .ncs.ea.ibs-infra.bt.com...
"Wolfgang Forstmeier" <wo************ *****@gmx.de> wrote in message
news:dm******** *****@news.t-online.com...


moriman wrote:
"Wolfgang Forstmeier" <wo************ *****@gmx.de> wrote in message
news:dm******** **@news.mch.sbs .de...

>
>moriman wrote:
>
>>"Juliette" <jr*********@jo keaday.net> wrote in message
>>news:43***** *************** ***@news.wanado o.nl...
>>
>>>moriman wrote:
>>>
>>>>wow, thx for the *very* quick reply ;-)
>>>>
>>>>tried changing the
>>>>echo "\$p = $p<br><br>";
>>>>
>>>>to
>>>>
>>>>echo "\$p = " . $_POST['p'] . "<br><br>";
>>>>
>>>>but still not working :(
>>>>
>>>>mori
>>>>
>>>>"Gordon Burditt" <go***********@ burditt.org> wrote in message
>>>>news:11*** **********@corp .supernews.com. ..
>>>>
>>>>
>>>>>>The script below *used* to work. I have only just set up a
>>>>>>server , PHP etc again on my Win98 system and now it doesn't?
>>>>>
>>>>>A variable passed from HTML by the POST method is $_POST['r'] or
>>>>>$_POST['p'], *not* $r or $p. (Also see $_GET for variables
>>>>>passed by the GET method). Fix your script. Do not turn
>>>>>on "register_globa ls".
>>>>>
>>>>>Gordon L. Burditt
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>>On first loading this page, you would have
>>>>>>
>>>>>>$p =
>>>>>>
>>>>>>and the button image below it.
>>>>>>On clicking the button the same page would reload but pass the

hidden

>>>>values
>>>>
>>>>
>>>>>>(r=w & p=f)
>>>>>>so that the first line of the page would then have
>>>>>>
>>>>>>$p = f
>>>>>>
>>>>>>This no longer works???
>>>>>>
>>>>>><?php
>>>>>>echo "<html><bod y>";
>>>>>>echo "\$p = $p<br><br>"; //###
>>>>>>$str = <<<HTM
>>>>>><head>
>>>>>></head>
>>>>>><body>
>>>>>><form action="" method="post">
>>>>>><input type="hidden" name="r" value="w">
>>>>>><input type="hidden" name="p" value="f">
>>>>>><input type="image" src="http://home/images/faq-up.gif" border="0">>>>>>height=" 22" width="77">
>>>>>></form>
>>>>>></body>
>>>>>></html>
>>>>>>HTM;
>>>>>>echo $str;
>>>>>>?>
>>>>>>
>>>>>>
>>>>>>on printing the $_ENV variables along with the the above script I

find

>>>>the
>>>>
>>>>
>>>>>>followin g :
>>>>>>
>>>>>>QUERY_ME THOD POST
>>>>>>REQUEST_ METHOD POST
>>>>>>FORM_P f
>>>>>>FORM_R w
>>>>>>
>>>>>>Is there something I haven't enabled in my
>>>>>>setup of PHP that is stopping this from working now?
>>>>>>
>>>>>>Or has something changed with PHP, so that I have to do this another>>
>>way?
>>
>>>>>>many thanks
>>>>>>
>>>>>>mori
>>>>>>
>>>>>>
>>>>>>
>>>>>
>>>Try:
>>>
>>>echo "\$p = " . $HTTP_POST_VARS['p'] . "<br><br>";
>>
>>nope, doesn't work either :(
>>
>>
>
>This will work, you have to set up an submit button
>(javascript or nativ html to send your form data)
>
>If you would like to have an image you should prefer JavaScript.
>If a simple HTML - Button is enougth try the simple Submit Button like
>in my example.
>Have Fun...
>
><?php
>echo "<html>";
>echo "\$p = ".$_POST['p']."<br><br>"; //###
>$str = <<<HTM
><head>
></head>
><body>
><form action="" method="post">
> <input type="hidden" name="r" value="w">
> <input type="hidden" name="p" value="f">
> <input type="submit">
></form>
></body>
></html>
>HTM;
>echo $str;
>?>
Did you try this wolfgang? I did and it doesn't work for me?

for me this has worked perfekt ..


This is where I think the problem lies, in that there may be something in
php.ini (or elsewhere) which isn't enabled that is preventing this working
for me.

Just can't figure out what or where :(


Ah!, finally found the prob, duh!
My Xitami server has an option to pass form fields with a prefix. The prefix
was set to 'FORM_'.
Removing this prefix allows my scripts to work again, phew!

Thanks for your input ;-)

thx

Nov 28 '05 #20

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
17423
by: jfixsen | last post by:
Hello! Oracle 9.2.0.4 SunOS pchi-db01 5.8 Generic_108528-19 sun4u sparc SUNW,Ultra-EnterpriseSystem = SunOS Node = pchi-db01 Release = 5.8 KernelID = Generic_108528-19 Machine = sun4u BusType = <unknown>
5
4616
by: Tyler Style | last post by:
Hullo - looking for a little advice here. I have a form on a page in one domain submitting to a cgi in another domain. Weirdly, on some Windows XP systems, a form on the page fails to submit/post properly to the cgi and users get the message from IE that it "Cannot find server: The page cannot be displayed The page you are looking for is currently unavailable. The Web site might be experiencing technical difficulties, or you may need to...
1
2213
by: Henry Reardon | last post by:
I'm having some migration problems. On Friday, I upgraded from DB2 7.2 (FP9) to DB2 8.2 (FP7), then applied Fixpack 8. I'm running Windows XP. My migrations did not work and I am trying to fix them manually. The Control Center gives me SQL0535 for some of the databases and SQL1039C for the others. I'll describe the SQL0535 problems in this note and make a separate post for SQL1039C.
10
2422
by: BBFrost | last post by:
We just recently moved one of our major c# apps from VS Net 2002 to VS Net 2003. At first things were looking ok, now problems are starting to appear. So far ... (1) ComboBox.SelectedValue = db_value; If the db_value was not included in the ComboBox value list the ComboBox.SelectedIndex used to return -1, Now the very same code is
19
2995
by: Dales | last post by:
I have a custom control that builds what we refer to as "Formlets" around some content in a page. These are basically content "wrapper" sections that are tables that have a colored header and provide an open TD with a DIV in it for the content of this formlet. (The DIV is for DHTML to hide and show the content) I've created a web page showing step by step the two problems I'm encountering. This problem is much easier to see than it...
17
2514
by: Lloyd Sheen | last post by:
This IDE is driving me nuts. I needed another button so I copied an existing one, changed the Text and the id and position by drag and drop. Well then I run and get the following: Control 'Button19' of type 'Button' must be placed inside a form tag with runat=server Can the IDE not do what it is supposed to do. It seems that it is a fight to make it do anything or did I do something wrong? It would seem silly to have to create a...
10
19181
by: Danny | last post by:
Hi all, I am having some odd problems with AJAX on Firefox (1.5). When I use GET as the request method everything works ok, but when I do a POST the remote function doesn't get the parameters I am passing to it. Everything works fine on IE 6. Here's a couple samples of what I am doing: // using GET url = 'http://www.myserver.com/cgi-bin/funct?key1=value1&key2=value2'
71
19155
by: desktop | last post by:
I have read in Bjarne Stroustrup that using malloc and free should be avoided in C++ because they deal with uninitialized memory and one should instead use new and delete. But why is that a problem? I cannot see why using malloc instead of new does not give the same result.
3
1391
Mobius Evalon
by: Mobius Evalon | last post by:
I've been staring at this problem and stabbing in the dark at it for a few hours now, and I've finally broken down to the point where I realize I need some help. I'm absolutely positioning most of the elements on my site, found here: http://mobiusevalon.tibbius.com/tibbius/ I'm having problems with the post information displayed at the top left of each post div. The first set appear where they're supposed to, but each consequent post...
34
5384
by: Alexnb | last post by:
Gerhard Häring wrote: No, it didn't work, but it gave me some interesting feedback when I ran it in the shell. Heres what it told me: Traceback (most recent call last): File "<pyshell#10>", line 1, in <module> os.startfile("C:\Documents and Settings\Alex\My Documents\My
0
9735
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10996
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10658
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10718
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10347
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9497
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7889
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
2
4133
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3171
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.