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><body>";
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 24 2745
>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_globals".
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><body>"; 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
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_globals".
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><body>"; 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
thefollowing :
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
Don't know much about PHP, but it does appear you are sending "<body>"
twice, once in line 2 and once in line 7. The one in line 2 should be
deleted so the "<head>" section of the page comes first. Or you need to
rearrange the order of your statements.
"PeteY48" <pe********@gmail.com> wrote in message
news:11*********************@z14g2000cwz.googlegro ups.com... Don't know much about PHP, but it does appear you are sending "<body>" twice, once in line 2 and once in line 7. The one in line 2 should be deleted so the "<head>" section of the page comes first. Or you need to rearrange the order of your statements.
Yes, you are right about the double <head>, this was due to shortening the
script and missing this repeat.
However, this makes absolutely no difference to the operation of the script.
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_globals".
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><body>"; 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>";
"Juliette" <jr*********@jokeaday.net> wrote in message
news:43***********************@news.wanadoo.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_globals".
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><body>"; 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 :(
moriman wrote: "Juliette" <jr*********@jokeaday.net> wrote in message news:43***********************@news.wanadoo.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_globals".
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><body>"; > 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;
?>
moriman wrote: 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><body>"; 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
How are you submitting your form? I don't see a submit button, for
instance.
--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp. js*******@attglobal.net
==================
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
> <?php echo "<html><body>"; 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 htmlspecialchars( $_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
"Wolfgang Forstmeier" <wo*****************@gmx.de> wrote in message
news:dm**********@news.mch.sbs.de...
moriman wrote: "Juliette" <jr*********@jokeaday.net> wrote in message news:43***********************@news.wanadoo.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_globals". > > 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><body>"; >> 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¿
"vdP" <hv**************@wanadoo.nl> wrote in message
news:43***********************@news.wanadoo.nl... 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 ;-)
"Hilarion" <hi******@SPAM.op.SMIECI.pl> wrote in message
news:dm**********@news.onet.pl... <?php echo "<html><body>"; 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 htmlspecialchars( $_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
moriman wrote: "Wolfgang Forstmeier" <wo*****************@gmx.de> wrote in message news:dm**********@news.mch.sbs.de...
moriman wrote:
"Juliette" <jr*********@jokeaday.net> wrote in message news:43***********************@news.wanadoo.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_globals". >> >>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><body>"; >>>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�
for me this has worked perfekt ..
"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*********@jokeaday.net> wrote in message news:43***********************@news.wanadoo.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_globals". >>> >>>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><body>"; >>>>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?
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
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*******@attglobal.net
==================
moriman wrote: "Hilarion" <hi******@SPAM.op.SMIECI.pl> wrote in message news:dm**********@news.onet.pl...
<?php echo "<html><body>"; 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 htmlspecialchars( $_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*******@attglobal.net
==================
"Jerry Stuckle" <js*******@attglobal.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><body>"; 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 htmlspecialchars( $_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($_REQUEST); ?><br>
gives
post Array ( )
get Array ( )
request Array ( ) -- ================== Remove the "x" from my email address Jerry Stuckle JDS Computer Training Corp. js*******@attglobal.net ==================
"moriman" <mo*****@btinternet.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*********@jokeaday.net> wrote in message >>news:43***********************@news.wanadoo.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_globals". >>>>> >>>>>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><body>"; >>>>>>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?
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
"moriman" <mo*****@btinternet.com> wrote in message
news:dm**********@nwrdmz03.dmz.ncs.ea.ibs-infra.bt.com... "Jerry Stuckle" <js*******@attglobal.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><body>"; >>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 htmlspecialchars( $_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($_REQUEST); ?><br>
gives
post Array ( ) get Array ( ) request Array ( )
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 ;-) -- ================== Remove the "x" from my email address Jerry Stuckle JDS Computer Training Corp. js*******@attglobal.net ==================
> [snip] <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.
In some browsers - yes. Read HTML specification. Value of
"action" attribute in "form" tag is REQUIRED.
Look here: http://www.w3.org/TR/REC-html40/inte...ms.html#h-17.3
quote:
"This attribute specifies a form processing agent. User agent
behavior for a value other than an HTTP URI is undefined."
Empty value is not a HTTP URI.
As you will also see from the OP, the data *is* being sent
As I wrote - some browsers may behave like this. Yours apparently
does behave like this (which means that the wrong value of
"action" attribute is not the cause of the problem). This does NOT
mean that all browser will, so if you want your form to be
submitable in some other browsers too, then you should specify
valid value.
[snip] <form action="<?php echo htmlspecialchars( $_SERVER['PHP_SELF'] ); ?>" method="post">
[snip]
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
Which means that your server configuration is somehow screwed.
$_SERVER['PHP_SELF'] should point to the URL of the script which
was originally called. Maybe some value in your php.ini suggests that
"http://home/public_html/" is your DOCUMENT_ROOT (or something like
that, I'm not sure).
Hilarion
Hi all,
I have followed this thread with interest as I have almost the exact same
problem. ( I am new to PHP and have inherited a project with 100's of files
like this which I am moving to a new server). I also posted a similar
question which Irwin Moller answered and gave me some good tips to work
with. I have two differences from moriman's problem:
1) I don't see ANY entries when I dump the environment variables.
2) If I leave the form Method="POST", but return the variables I want as
"GET" args after the "?" then $_GET('name') works.
BTW-Moriman, Would you please post the specific's of the setting you found
in the Xtami server? I'm on Apache but there might be something similar
that I haven't found yet.
What I really don't understand is why GET will work but POST doesn't.
TIA for any suggestions on what to look for.
Marty
"moriman" <mo*****@btinternet.com> wrote in message
news:dm**********@nwrdmz02.dmz.ncs.ea.ibs-infra.bt.com... "moriman" <mo*****@btinternet.com> wrote in message news:dm**********@nwrdmz03.dmz.ncs.ea.ibs-infra.bt.com... "Jerry Stuckle" <js*******@attglobal.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><body>"; >>>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 htmlspecialchars( $_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($_REQUEST); ?><br>
gives
post Array ( ) get Array ( ) request Array ( )
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 ;-)
-- ================== Remove the "x" from my email address Jerry Stuckle JDS Computer Training Corp. js*******@attglobal.net ==================
I don't know if you realize this, but you are using the wrong brackets on
the array $_GET['name'].
GET is used for URL variables/fields. POST is used for the other
"invisible" method of passing form fields. $_REQUEST[] will see form fields
from either method if I remember correctly.
$HTTP_POST_VARS and $_HTTP_GET_VARS are deprecated (being tossed). I have
heard someone post a complaint that it was not working in the latest PHP,
but that seems out of style with PHP's thing for compatibility - but it's a
warning nonetheless.
"Marty Meyers" <ma****@execpc.com> wrote in message
news:11*************@corp.supernews.com... Hi all, I have followed this thread with interest as I have almost the exact same problem. ( I am new to PHP and have inherited a project with 100's of files like this which I am moving to a new server). I also posted a similar question which Irwin Moller answered and gave me some good tips to work with. I have two differences from moriman's problem: 1) I don't see ANY entries when I dump the environment variables. 2) If I leave the form Method="POST", but return the variables I want as "GET" args after the "?" then $_GET('name') works.
BTW-Moriman, Would you please post the specific's of the setting you found in the Xtami server? I'm on Apache but there might be something similar that I haven't found yet.
What I really don't understand is why GET will work but POST doesn't. TIA for any suggestions on what to look for. Marty
"moriman" <mo*****@btinternet.com> wrote in message news:dm**********@nwrdmz02.dmz.ncs.ea.ibs-infra.bt.com... "moriman" <mo*****@btinternet.com> wrote in message news:dm**********@nwrdmz03.dmz.ncs.ea.ibs-infra.bt.com... > > "Jerry Stuckle" <js*******@attglobal.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><body>"; > > >>>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 htmlspecialchars( $_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($_REQUEST); ?><br> > > gives > > post Array ( ) > get Array ( ) > request Array ( ) > >
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 ;-)
> > > > -- > > ================== > > Remove the "x" from my email address > > Jerry Stuckle > > JDS Computer Training Corp. > > js*******@attglobal.net > > ================== > > > > >
"Jim Michaels" <jm******@yahoo.com> wrote in message
news:Xt********************@comcast.com... I don't know if you realize this, but you are using the wrong brackets on the array $_GET['name']. GET is used for URL variables/fields. POST is used for the other "invisible" method of passing form fields. $_REQUEST[] will see form
fields from either method if I remember correctly.
$HTTP_POST_VARS and $_HTTP_GET_VARS are deprecated (being tossed). I have heard someone post a complaint that it was not working in the latest PHP, but that seems out of style with PHP's thing for compatibility - but it's
a warning nonetheless.
"Marty Meyers" <ma****@execpc.com> wrote in message news:11*************@corp.supernews.com... Hi all, I have followed this thread with interest as I have almost the exact
same problem. ( I am new to PHP and have inherited a project with 100's of files like this which I am moving to a new server). I also posted a similar question which Irwin Moller answered and gave me some good tips to work with. I have two differences from moriman's problem: 1) I don't see ANY entries when I dump the environment variables. 2) If I leave the form Method="POST", but return the variables I want
as "GET" args after the "?" then $_GET('name') works.
BTW-Moriman, Would you please post the specific's of the setting you
found in the Xtami server? I'm on Apache but there might be something
similar that I haven't found yet.
What I really don't understand is why GET will work but POST doesn't. TIA for any suggestions on what to look for. Marty
-----snip------
Hi Jim,
Yep, a typo on my part with the wrong brackets when I created the email. I
use them correctly in the code.
The backward compatibility problem is accurate. I had to fix it because I
did not want to turn "register_globals" in php.ini 'on'.
My problem with the POST variables turned out to be a problem with the
"sitepreview" that is being used to test the new server. Someone else was
able to find the problem and got it fixed. I don't know the details yet. I
don't know what "sitepreview" is or what it involves.
I'm pretty new to web programming
Thanks
Marty This discussion thread is closed Replies have been disabled for this discussion. Similar topics
2 posts
views
Thread by jfixsen |
last post: by
|
5 posts
views
Thread by Tyler Style |
last post: by
|
1 post
views
Thread by Henry Reardon |
last post: by
|
10 posts
views
Thread by BBFrost |
last post: by
|
19 posts
views
Thread by Dales |
last post: by
|
17 posts
views
Thread by Lloyd Sheen |
last post: by
|
10 posts
views
Thread by Danny |
last post: by
|
71 posts
views
Thread by desktop |
last post: by
| |
34 posts
views
Thread by Alexnb |
last post: by
| | | | | | | | | | |