Click to See Complete Forum and Search --> : Hiding variables in URL..again!?


tobyw_1969
07-10-2003, 12:30 AM
I'm really struggling with this whole thing.

I am calling a PHP page from an HTML page like this

<a href = "page.php?var1=xxx&var2=xxx">

But when I do that it shows up all the variables in the address bars. I know there is a method "POST" instead of "GET"..but the only way I know to change that is using a form....

If I am just using an href link like this, is there a way to make it so that the variables won't show up in the URL bar?

I tried to do this..

<a href="page.php?var1=xxx" method="POST">

But that doesn't make any difference - was just a guess...is there a simple way to do this, or can I only hide the variables if I am using a form?

Thanks a lot.

Toby

pyro
07-10-2003, 07:23 AM
Originally posted by tobyw_1969
...or can I only hide the variables if I am using a form?I believe so...

Bootsman123
07-13-2003, 01:54 PM
You can't hide variables in urls only in forms.

AdamGundry
07-13-2003, 02:12 PM
You could make it so the link causes a hidden form to submit, using something like this:

<a href="no_js.html" onclick="document.forms[0].submit(); return false">Submit first form on page</a>

Of course, this will fail if the user has JS disabled.

Adam

cyborg
07-14-2003, 01:56 AM
er, when I use session id, it automatically tags on the phpsessionid to all my links... is there a way to prevent it from doing that?

AdamGundry
07-14-2003, 02:23 AM
Not as far as I'm aware, but then I don't use PHP-handled sessions. Some of the others may be able to help you.

Of course, you could use something other than the inbuilt session-management facilities.

Adam