OK, I'm a beginner, if someone can help with this one task, i think I can then use that for many tasks.
I have a login form, which checks a username/pw against a mssql database. Currently, if username/pw is good, the page redirects to a hard-coded page. However, in the record for the logging-in user, I have a field called specURL which contains a path to a page I want to go to instead of the hard-coded page.
So, I imagine that I have to query for that specURL field, put it into a variable, and then use a location command with that variable to direct the user to the right page.
I have never written a query. Here is a portion of the current code for the login. If someone could help determine what needs to be changed to access that stored URL, I would appreciate it Thanks. Andy:
// Verify Login is correct
$query_rsLogin = sprintf("SELECT username, password FROM users WHERE username = '%s' AND password = '%s'", $myUsername_rsLogin,$myPassword_rsLogin);
$rsLogin = mysql_query($query_rsLogin, $SBmssql) or die(mysql_error());
$row_rsLogin = mysql_fetch_assoc($rsLogin);
$totalRows_rsLogin = mysql_num_rows($rsLogin);
// Buzz inet PHPLS01 - Login & Set Session - Main
if($HTTP_POST_VARS['action']=="login"){
if($totalRows_rsLogin==0){
$errorMessage = "";
mysql_free_result($rsLogin);
} else {
mysql_free_result($rsLogin);
session_register("userSession");
$HTTP_SESSION_VARS['userSession'] = $HTTP_POST_VARS['username'];
header("Location: confidential.php");
}
}