Wybaczcie ale jestem jeszcze przedszkolakiem w dziedzinie php. Tak myslałem o przekierowaniu z poziomu level ale jak to zrobić?
Proszę o wszelaką pomoc i zgóry dziękuje za zainteresowanie się tematem.
login.php
<?php require_once('Connections/local.php'); ?> <?php if (!function_exists("GetSQLValueString")) { function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "") { if (PHP_VERSION < 6) { } $theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue); switch ($theType) { case "text": $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL"; break; case "long": case "int": break; case "double": break; case "date": $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL"; break; case "defined": $theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue; break; } return $theValue; } } ?> <?php // *** Validate request to login to this site. } $loginFormAction = $_SERVER['PHP_SELF']; $_SESSION['PrevUrl'] = $_GET['accesscheck']; } $loginUsername=$_POST['user']; $password=$_POST['pass']; $MM_fldUserAuthorization = "level"; $MM_redirectLoginSuccess = "profile.php"; $MM_redirectLoginFailed = "register.php"; $MM_redirecttoReferrer = false; $LoginRS__query=sprintf("SELECT username, password, level FROM login WHERE username=%s AND password=%s", GetSQLValueString($loginUsername, "text"), GetSQLValueString($password, "text")); if ($loginFoundUser) { //declare two session variables and assign them $_SESSION['MM_Username'] = $loginUsername; $_SESSION['MM_UserGroup'] = $loginStrGroup; $MM_redirectLoginSuccess = $_SESSION['PrevUrl']; } } else { } } ?> <div align="center"> <p> </p> <p> </p> <p> </p> <p> </p> <p> </p> <p> </p> <table width="415" border="0" cellspacing="0" cellpadding="0"> <tr> <td width="91"><label for="user"> <div align="center">Username: </label> </div></td> <td width="324"><div align="left"> <input type="text" name="user" id="user"> </div></td> </tr> <tr> <td height="29"><label for="pass"> <div align="center">Password: </label> </div></td> <td><div align="left"> <input type="password" name="pass" id="pass"> </div></td> </tr> <tr> <td colspan="2"><div align="center"> <input type="submit" name="submit" id="submit" value="Login"> </div></td> </tr> </table> <p> </p> <p> </p> <p> </p> <p> </p> </div> </form>