On Wednesday 13 March 2002 23:37, John Gurley wrote:
> Thanks everyone for the help. Finally got it working using this:
> <?php
> echo '<input name = "inp" type = "hidden" value =';
> echo ("$_POST '$inp'");
> echo '>';
> ?>
> Don't hhave a clue why this worked and the others didn't?!?!?

This isn't working correctly. The fact that it 'works' is just a fluke.

I asked many posts earlier what version of PHP you was using, I don't seem to 
have gotten an answer. But your subsequent posts seems to suggest that you're 
using php < 4.1.1 and hence why $_POST['inp'] does not work.

php <= 4.0.6 used $HTTP_POST_VARS[] to hold the values which are the result 
of a POST.

With php >= 4.1.1 $HTTP_POST_VARS[] has become $_POST[].

So if my assumption is correct in that you're using php < 4.1.1 then

 echo ("$_POST '$inp'");

is in fact equivalent to:

 echo (" '$inp'");  ## because $_POST is most likely undefined

That is why it seems to work, but you're getting an extra space and single 
quotes around your value.

To really get it working, you should probably use:

 echo ("$HTTP_POST_VARS[inp]");

Jason Wong -> Gremlins Associates -> www.gremlins.com.hk

To the landlord belongs the doorknobs.

PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to