Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

passing a value to another page

Status
Not open for further replies.

shaggy56

Programmer
Mar 16, 2003
12
US
I am having a hard time trying to get a good user authentication page to work. The authentication works for the one page but if I try to pass the value of the variable to the link it won't work (because I have no clue how to). I need to be able to block the linked page too unless the user logs in correctly.
 
are you using file or mysql to store username and password? where exactly did you get some problems and what's the error code or error messages?

if the authentication process is successful, $_SESSION varibles will make it easy for you to block access to the link page if the user has not login or has invalid username and password...
 
I am using mysql to check the username and passwords. Basically when I try to go to the link it says that the username and password when checked against the database are blank.
 
Hi there!
I'm still new to this myself but I've been there done that as they say...

The key is probably in the way you're passing along the username and password from the second page to the third.

If your original username field is for example $_POST[username]

Have the following on your second (and each consecutive page thereafter):

<input type=&quot;hidden&quot; name=&quot;username&quot; value='<? echo &quot;$_POST[username]&quot;; ?>'>

Make sure that the name of the hidden fields matches your original text area field, as it does in my example.
Hope this helps.


An idle mind is the Devil's workshop!!
 
thank you all very much for you help. I am still trying to get the hang of php.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top