scheols Posted June 22, 2006 Share Posted June 22, 2006 Alright im editing a IPB forum page <okAnyways how would i check to see if im on a page using the if statement.or how could i check for the file on the IPB index.php page?:heres the index.php part i want to check[code]//--------------------------------// Wrap it all up in a nice easy to// transport super class//--------------------------------[b]$ibforums = new info();[/b]//--------------------------------// Require our global functions//--------------------------------require ROOT_PATH."sources/functions.php";require ROOT_PATH."sources/classes/class_display.php";require ROOT_PATH."sources/classes/class_session.php";require ROOT_PATH."sources/classes/class_forums.php";require KERNEL_PATH."class_converge.php";$std = new FUNC;$print = new display();$sess = new session();$forums = new forum_functions();//--------------------------------// Set up our vars//--------------------------------$ibforums->input = $std->parse_incoming();//--------------------------------// Set converge//--------------------------------[/code]Answer either of the questions plz or both thanks. Ive put the bold tags around the Part i want to check for Quote Link to comment https://forums.phpfreaks.com/topic/12674-php-page-checking/ Share on other sites More sharing options...
Eric_Ryk Posted June 22, 2006 Share Posted June 22, 2006 [code]if($_GET['page'] == "foobar"){ // your code}[/code]Just a simple example to show you. Or perhaps if you want a page where there are no URL variables:[code]if(count($_GET) == 0)[/code] Quote Link to comment https://forums.phpfreaks.com/topic/12674-php-page-checking/#findComment-48602 Share on other sites More sharing options...
scheols Posted June 22, 2006 Author Share Posted June 22, 2006 [!--quoteo(post=386976:date=Jun 22 2006, 03:51 PM:name=Eric_Ryk)--][div class=\'quotetop\']QUOTE(Eric_Ryk @ Jun 22 2006, 03:51 PM) [snapback]386976[/snapback][/div][div class=\'quotemain\'][!--quotec--][code]if($_GET['page'] == "foobar"){ // your code}[/code]Just a simple example to show you. Or perhaps if you want a page where there are no URL variables:[code]if(count($_GET) == 0)[/code][/quote]would this get the page that the code is in? like say i upload a file called thispage.phpwoould the $_GET["page"] get thispage.php or would i have to tell the code what page im on? Quote Link to comment https://forums.phpfreaks.com/topic/12674-php-page-checking/#findComment-48606 Share on other sites More sharing options...
Eric_Ryk Posted June 22, 2006 Share Posted June 22, 2006 Certain pages are loaded based upon what is put inside of the URL. $_GET["page"] may or may not contain a value in this case, I was just giving an example.What you need to do is find out what all is in the URL when you are on the page you want, then do checks based upon those. Quote Link to comment https://forums.phpfreaks.com/topic/12674-php-page-checking/#findComment-48608 Share on other sites More sharing options...
scheols Posted June 22, 2006 Author Share Posted June 22, 2006 if(count($_GET) == 0){alright what does that do can u plz tell me Quote Link to comment https://forums.phpfreaks.com/topic/12674-php-page-checking/#findComment-48611 Share on other sites More sharing options...
Eric_Ryk Posted June 22, 2006 Share Posted June 22, 2006 [!--quoteo(post=386985:date=Jun 22 2006, 05:18 PM:name=scheols)--][div class=\'quotetop\']QUOTE(scheols @ Jun 22 2006, 05:18 PM) [snapback]386985[/snapback][/div][div class=\'quotemain\'][!--quotec--]if(count($_GET) == 0){alright what does that do can u plz tell me[/quote]If there are no variables in the URL then that express will come out to be true. Quote Link to comment https://forums.phpfreaks.com/topic/12674-php-page-checking/#findComment-48614 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.