I have a database for my members frm_status, this entry contains text as to the members status e.g member, non member. When my members login to their account I would like non members to be directed to a different page. Im really struggling on how to do this, is there some way that I could add something to the top of a page which does this? If member status is (get text from frm_status "non member" ) redirect to guest area Else do nothing …stay in member area. sorry for the question im so use to vb and php is blowing me way.......
if ($frm_status == "member") { //stay on this page. rest of code } else { header('Location: somewhereelse.php'); } PHP:
I like what papa_face has given you, but personally, I would go the other way with it: if ($frm_status != "member") { header('Location: somewhereelse.php'); } else { // page // } PHP: It doesn't matter which way you do it (both will work), but systematically (if that is word) it's how I would do it...
OK tried that and im still erroring, the following code must be close I hope, any ideas will be greatful. 'groupid' is the db field and it is a number, value Gname = "Non Member" <?php if ($_SESSION['groupid'] $connector != "21") { header("location: ../paper_1.php"); } else { header ("location: ../login.php?ErrorMessage=".$Language['sv_member'] ['error1']); exit(); } ?> i keep erroring on these lines: <?php if ($_SESSION['groupid'] $connector != "21") { header("location: ../paper_1.php"); have tried: <?php if ($_SESSION['groupid'] != "21") header("location: http://www.mysite.com/paper_1.php");
This is a parse error <?php if ($_SESSION['groupid'] $connector != "21") Code (markup): Do you want to check both values $connector and $_SESSION['groupid'], If so use following code <?php if ($_SESSION['groupid'] == "21" && $connector != "21") { header("location: ../paper_1.php"); PHP:
Thanks for this i think the issue may be down to the connection? eg session? every time no matter if i login as Full member,admin or Lifetime member (package) i always redirected to Page_1.php frm_groups has a field called gName <?php if($_SESSION['gName'] != "Life Time Member") { header ("location: ../page_1.php"); exit(); } ?>
Thanks for this i think the issue may be down to the connection? eg session? every time no matter if i login as Full member,admin or Lifetime member (package) i always redirected to Page_1.php frm_groups has a field called gName <?php if($_SESSION['gName'] != "Life Time Member") { header ("location: ../page_1.php"); exit(); } ?>