Jump to content

Php Page Checking.


scheols

Recommended Posts

Alright im editing a IPB forum page <ok

Anyways 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
Link to comment
Share on other sites

[!--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.php

woould the $_GET["page"] get thispage.php or would i have to tell the code what page im on?
Link to comment
Share on other sites

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.
Link to comment
Share on other sites

[!--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.
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.