Dracolas Posted January 8, 2010 Share Posted January 8, 2010 How would I go about Making it where only certain ranks can see a Recruit page. i have the console done and the Recruit page done and I think i should go like If ($crank = 0) Than(include recruit.php) But then couldn't anyone who knows about recruit.php view it and recruit people?... how could I do this? Link to comment https://forums.phpfreaks.com/topic/187745-page-only-if-rank/ Share on other sites More sharing options...
aebstract Posted January 8, 2010 Share Posted January 8, 2010 if($crank != 0) { header("Location: /index.php"); } Something similar to that, put it at the top. If crank isn't 0, then it'll shoot them to whatever page you choose. Could be back to the page they previously were at or whatever. Link to comment https://forums.phpfreaks.com/topic/187745-page-only-if-rank/#findComment-991223 Share on other sites More sharing options...
Dracolas Posted January 8, 2010 Author Share Posted January 8, 2010 Ok, so i put that at the top of recruit.php Then how do i tell it where to send them...i want them to be sent to norank.php Link to comment https://forums.phpfreaks.com/topic/187745-page-only-if-rank/#findComment-991226 Share on other sites More sharing options...
The Little Guy Posted January 8, 2010 Share Posted January 8, 2010 just change "/index.php" in the header function to what ever page you want... Link to comment https://forums.phpfreaks.com/topic/187745-page-only-if-rank/#findComment-991235 Share on other sites More sharing options...
Dracolas Posted January 12, 2010 Author Share Posted January 12, 2010 Ok i'm using the If else stuff to get it done but i'm having issues... i have if ($crank <= 4) then then recruit stuff...the account that i'm using is rank 6 and is still able to access the page...why is this? I know that i have all but that line right because if i change it to crank = 0 and try with the 6 it uses the else... so what's going on? Link to comment https://forums.phpfreaks.com/topic/187745-page-only-if-rank/#findComment-993676 Share on other sites More sharing options...
Dracolas Posted January 12, 2010 Author Share Posted January 12, 2010 No one knows? Link to comment https://forums.phpfreaks.com/topic/187745-page-only-if-rank/#findComment-993719 Share on other sites More sharing options...
The Little Guy Posted January 12, 2010 Share Posted January 12, 2010 right before your if statement, echo out $crank to make sure it is 100% the correct value. Link to comment https://forums.phpfreaks.com/topic/187745-page-only-if-rank/#findComment-993738 Share on other sites More sharing options...
Dracolas Posted January 12, 2010 Author Share Posted January 12, 2010 Do me a fav and check that out...tell me where i'm messing up... http://www.sourcepod.com/etmpro14-2492 btw the crank displayed correctly Link to comment https://forums.phpfreaks.com/topic/187745-page-only-if-rank/#findComment-993747 Share on other sites More sharing options...
The Little Guy Posted January 12, 2010 Share Posted January 12, 2010 what if you did this on line 19. This: $crank = $rankname[$row['rank']]; to this: $crank = $row['rank']; Link to comment https://forums.phpfreaks.com/topic/187745-page-only-if-rank/#findComment-993753 Share on other sites More sharing options...
Dracolas Posted January 12, 2010 Author Share Posted January 12, 2010 ty...i'm pretty sure that fixed it and i understand why that was a problem. Link to comment https://forums.phpfreaks.com/topic/187745-page-only-if-rank/#findComment-993773 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.