Jump to content

Putting URL values into inputs


jacketh

Recommended Posts

Hello there,

 

I've been searching for the answer to this for a while but haven't got anywhere. I'm fairly new at the whole PHP scripting so I maynot be phrasing it correctly :P Basically I just want a couple of things to happen:

 

1) A user registers and is shown a page confirming successful registration. This page confirms there details, tells them an email is on the way and they may now login. The problem lies here, I have made it so it inputs the username into the url. For example we end up with something like www.xxxxx.com/login.php?user=Jacketh. I would like it so that username value is input into the Username: input type on the login page. I'm guessing there must be some coding as that link doesn't actually put anything into it, the input does have id and name both as user.

 

2) Pretty much the same for the email confirmation, the link does the same and creates a query string that inputs the info into the specific fields.

 

Is there a way to then click the submit button automatically or something? Hence if I input there username and password through the string and enforce automatic login? This would be nice if possible!

 

Thanks,

Jacketh

Link to comment
Share on other sites

Question One:

<?php
$username = $_GET['user'];
echo "<input type=\"text\" name=\"username\" value\"".$username."\"/>";
?>

 

Dont quite understand question two sorry. I think your asking to pass the login credentials through the URL and have it auto login the user. This is very unsafe and in my opinion stupid (no offence) most passwords in databases are encrypted ($pass = md5($pass)) so that there would be no way to know what the actually password it because the only way to have pass equal the md5 is by typing in the right password.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.