Jump to content

Splitting POST and GET or how to pass the password


vanyok
 Share

Recommended Posts

Hey guys :) Sorta new to PHP here but getting better day after day. I have a question that I cant seem to figure out.Lets say I have a login form that asks user for the ID and Password.How do I pass the user name as $_GET so it displays in the address bar but pass the password as $_POST so no one can see what the password is ?Is there another way to go about it ? Possibly encrypt that password in the address bar? ( but I'd need to run SSL for that, right ? )Thank you :)

Link to comment
Share on other sites

Maybe you could use javascript to change the action for your form just before submitting so that the userid is passed as a query string while the form itself is submitted via POST. Maybe something like this:

<form action="mypage.php" method="POST" onsubmit="updateAction(this);"><input type="text" id="userid" /><input type="password" id="password" /><input type="submit" /></form><script type="text/javascript">function updateAction(obj){	var userid = document.getElementById("userid").value;	obj.action += "?userid=" + userid;}</script>

Link to comment
Share on other sites

No way to go without Java ? I'm not familiar with it :)
Maybe you could submit all of your form data with a POST and then look into URL rewriting to change the URL the user sees in the address bar of the browser. If you search through this forum, you should see a number of posts about URL rewriting.
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...