0

Help!!!

Ok I have been on this problem all day. Searching and Searching and just when I thought I
had it...the script didn't work as it was supposed to.

My URL looks like this:

http://mysite.com/joinform.php?Email=mymail@gmail.com&Username=newuser&Password=12345678

I need to parse the email, username and password from the url into the form fields on the
page. So far I have only been able to parse the whole URL :(

Thanks in advance for your help.

3
Contributors
4
Replies
5
Views
6 Years
Discussion Span
Last Post by Airshow
0

$_REQUEST is a combination of the $_GET and $_POST arrays
S_POST is the array of a form submission
$_GET is the array of this type of parameter

http://mysite.com/joinform.php?Email=mymail@gmail.com&Username=newuser&Password=12345678

for single use (php is simple)

echo $_GET['Email'];
echo $_GET['Username'];
echo $_GET['Password'];

for multiple use

$Email = $_GET['Email'];
$Username = $_GET['Username'];
$password = $_GET['Password'];
/* all kinds of code to do whatever with these variables */
var url = String(window.location);
var index = url.indexOf("?");
var data = url.substr(index+1);
var splitted = data.split("=");
var Email = splitted[0].substring(0,splitted[0].indexOf('&'));
var Username = splitted[1].substring(0,splitted[1].indexOf('&'));
var Password = splitted[2];

Javascript is difficult for me, confirm this code works,
but the premise is there to work on

It is not very secure to get a password, the password is visible in the addressbar
such is usually Post-ed

Edited by almostbob: n/a

0

Ok I understand the issue of having the password in the URL so how can I pass the password to the form field?

0

Ok I understand the issue of having the password in the URL so how can I pass the password to the form field?

You should never send a password back from server to client and you should never need to.

Airshow

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.