vanyok Posted December 27, 2006 Share Posted December 27, 2006 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 More sharing options...
jesh Posted December 27, 2006 Share Posted December 27, 2006 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 More sharing options...
vanyok Posted December 27, 2006 Author Share Posted December 27, 2006 No way to go without Java ? I'm not familiar with it Link to comment Share on other sites More sharing options...
specialguy Posted December 28, 2006 Share Posted December 28, 2006 No way to go without Java ? I'm not familiar with it I really doubt there is a way to do this in PHP >.< Link to comment Share on other sites More sharing options...
jesh Posted December 28, 2006 Share Posted December 28, 2006 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 More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now