Zubrag.com
September 25, 2018, 07:23:32 AM *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: How to use login info (username) as global variable  (Read 3799 times)
yunker
Newbie
*
Posts: 3


« on: May 14, 2015, 02:48:36 PM »

Is there a way to use the USERNAME from the login as a global variable so that users don't have to re-enter the info when on other protected pages? (FYI... we use email addresses for our usernames.)

Thank you in advance!

Logged
zubrag
Administrator
Hero Member
*****
Posts: 788


WWW
« Reply #1 on: May 15, 2015, 05:12:16 AM »

It should request login only once. Should not ask again when on other protected pages. If it asks you all the time, this means:
1) cookies are disabled in browser
OR
2) protection string is not the fist string in protected pages (there must be not even single character before protection string).
Logged
yunker
Newbie
*
Posts: 3


« Reply #2 on: May 15, 2015, 07:31:16 AM »

Thank you for the prompt response. However I apologize, I didn't explain myself correctly...

When I meant it was asking for their username/email address again, I didn't mean the security or Password Protect. What I meant was, within the protected pages we have a few HTML forms that our users can submit to us with questions or requests for supplies and on that form we have to ask them for their email address so that we know who it is that's making the request. Our thought was that since they are already entering that information on the login screen that maybe we could use that field as a PHP variable so that we can refer back to and submit along with any of the HTML forms.

Hopefully that all makes sense.
Logged
zubrag
Administrator
Hero Member
*****
Posts: 788


WWW
« Reply #3 on: May 15, 2015, 08:28:59 AM »

You'll have to change script like described here
http://www.zubrag.com/forum/index.php?topic=133.0

Username will be stored in session, and you can use it in other places. Does it help?
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by SMF 1.1.11 | SMF © 2006-2009, Simple Machines LLC