Page 1 of 1

How to use $_POST and $_GET in url bar?

Posted: Sat Jan 07, 2006 5:54 am
by kaisellgren
I need to use url bar to send information and I need to send it as $_POST. How to do it? Currently I have: http://www.domain.com/email.php?name=my ... s=password How to make it as $_POST ?

Posted: Sat Jan 07, 2006 6:10 am
by sheila
You can't.

Posted: Sat Jan 07, 2006 6:15 am
by patrikG
in the HTML-form instead of

Code: Select all

<form method="GET" action="...">
use

Code: Select all

<form method="POST" action="...">

Posted: Sat Jan 07, 2006 6:16 am
by twigletmac
If you explain why you need to do this we may be able to offer you other options.

Mac

Posted: Sat Jan 07, 2006 6:42 am
by kaisellgren
I have made a EmotIcon maker program. And I have feedback form in it. I thought I would open a url to send to form from my program...

Posted: Sat Jan 07, 2006 6:52 am
by mickd
generally its very insecure to have passwords and other sensitive information sent via $_GET, but if it must be done i would at least encode your url query string...

Posted: Sat Jan 07, 2006 6:54 am
by kaisellgren
Well, I don't understand what you were saying :S :(
I am not sending any passwords, that was just an example. In fact, I use FeedBack Form in my program and that form has Name, Email, Subject and comment field. "i would at least encode your url query string..." ?

Posted: Sat Jan 07, 2006 6:58 am
by patrikG
In the feedback form change the method from post to get.

Posted: Sat Jan 07, 2006 6:59 am
by kaisellgren
Ah, I have always wondered what's different between POST and GET. Does GET work if I "send" the form info with typing in the url bar?

Posted: Sat Jan 07, 2006 7:02 am
by mickd
look up "phpsecureurl" at http://www.phpclasses.org/

it should be under security

theres lots of different classes there that does the same thing btw

basically it gets your

?var1=thet&var2=rehr&var3=grerg

and turns it into something like

?var=rkjglregjelrgjelgjlrjlwekgwjrgwrjgwlkgjl

which it would "decode" in your php script back to

?var1=thet&var2=rehr&var3=grerg

Posted: Sat Jan 07, 2006 7:03 am
by mickd
kaisellgren wrote:Ah, I have always wondered what's different between POST and GET. Does GET work if I "send" the form info with typing in the url bar?
yes

edit: if i understood you correctly.

Posted: Sat Jan 07, 2006 7:03 am
by kaisellgren
Thank you for your help! You have saved my day! :D

Posted: Sat Jan 07, 2006 7:05 am
by patrikG
kaisellgren wrote:Ah, I have always wondered what's different between POST and GET. Does GET work if I "send" the form info with typing in the url bar?
The "form info" in the URL bar is the GET-request. For more info, see http://uk2.php.net/manual/en/language.v ... ternal.php

Posted: Sat Jan 07, 2006 7:07 am
by kaisellgren
Oh, thank you. Now I know what to do to make it working... Thank you very much you guys for helping me!