![]() |
|
#1
|
|||
|
|||
Login Page troublesHello
I am new here and new to PHP and MYSQL. I have created a working (phew) login page that authenticates users via php and a mysql database. Now what I am trying to figure out is I have a multi page questionnaire, if they exit and return how they can return to the same place they left or if they finish the questionnaire they cannot login again (and instead get a message saying the already finished it). Using cookies or session variables is ok but I can find no info on this anywhere!!! The date they answer on the questionnaire is stored in a seperate MYSQL database so I guess the 2 need to be linked (joined?) Thanks! |
|||
|
#2
|
||||
|
||||
|
Hello badronald,
I have not done something similar to be honest, but I did think about this for a while and here's what I would suggest: Set a cookie named for example 'questionnaires'. Inside it, you could have the following sample array: PHP Code:
Looking at the example data above, you (your script) can easily match the $_SESSION['user_name'] (if john is logged in, it would be 'john') to match it with the $_COOKIE['questionnaire']['john'], i.e. if( isset($_COOKIE['questionnaire'][$_SESSION['user_name']]) ). If it's a match, you can load the array $_COOKIE['questionnaire']['john'] into your script and do the necessary. Added: you need to serialize( $_COOKIE['questionnaires'] ); before you set the cookie, and unserialize( $_COOKIE['questionnaires'] ); before you work on it in your scripts... __________________
J de Silva Learning Journal | GIDForums™ | GIDNetwork™ | GIDWebhosts™ | GIDSearch™ |
Recent GIDBlog
Problems with the Navy (Chiefs) by crystalattice
| Thread Tools | Search this Thread |
| Rate This Thread | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Position Error on Search page | BobbyDouglas | GIDForums™ | 4 | 28-Jul-2004 17:35 |
| What's wrong with this page? | Socrates Demise | Websites Reviewed Forum | 2 | 31-Mar-2004 10:50 |
| simple form from generated page | zuzupus | Web Design Forum | 0 | 17-Sep-2003 10:27 |
| [script] E-mail webmaster error page | BobbyDouglas | PHP Code Library | 0 | 19-Aug-2003 21:10 |
| Search Engine Positioning 101 and 201 "How To" Tips... | 000 | Search Engine Optimization Forum | 0 | 29-May-2003 11:34 |
Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The