KyleSmith
08-02-2010, 12:26 PM
I have some PHP code where i need it so it will redirect them to the homepage if the accounttype is standard.
I have the code but it dont seem to be redirecting them.
<?php session_start();
include 'config.php';
$username = addslashes($_POST['username']);
$sql = "SELECT adminlevel,accounttype FROM users WHERE username = '" . $username . "' AND accounttype = 'standard'";
echo MySQL_Error();
$result = mysql_query($sql);
$row = mysql_fetch_row($result);
if(!isset($_SESSION['logged_in']) || !isset($_SESSION['username'])) {
header("location: index.php");
exit;
}
if($row['accounttype'] == 'standard') {
header("location: index.php");
exit;
}
?>
<style type="text/css">
<!--
body {
background-image: url(http://lv-cnr.com/bg.png);
}
-->
</style>
I have the code but it dont seem to be redirecting them.
<?php session_start();
include 'config.php';
$username = addslashes($_POST['username']);
$sql = "SELECT adminlevel,accounttype FROM users WHERE username = '" . $username . "' AND accounttype = 'standard'";
echo MySQL_Error();
$result = mysql_query($sql);
$row = mysql_fetch_row($result);
if(!isset($_SESSION['logged_in']) || !isset($_SESSION['username'])) {
header("location: index.php");
exit;
}
if($row['accounttype'] == 'standard') {
header("location: index.php");
exit;
}
?>
<style type="text/css">
<!--
body {
background-image: url(http://lv-cnr.com/bg.png);
}
-->
</style>