I understand the concept of session variables, so I want to know the best
methodology of approaching this:

1) HTML redirect to PHP page
2) PHP page looks for session
  a) If found, show some stuff
  b) If not found, prompt user for username and password
3) If no session, prompt user for username and password, once entered & is
ok, set session and redirect

Following is a code snippet I borrowed that I think would work, correct me
if I'm wrong:

// Setting a name for our session.
session_name("hasLoggedIn");
// Starting Session.
session_start();
// Register vars into session
session_register("username");
// Setting values for session vars.
$HTTP_SESSION_VARS["username"]=$HTTP_POST_VARS["username"];
// Referring a session info to another PHP.
echo "<A HREF=\"somefile.php?" . session_name() . "=" . session_id() .
"%s\">text</A>";

Thanx!!
Phil




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to