Jump to content


Photo

$path = ??? ;


  • Please log in to reply
2 replies to this topic

#1 Darkness Soul

Darkness Soul
  • Members
  • PipPipPip
  • Advanced Member
  • 133 posts
  • LocationBrazil; São Paulo.

Posted 17 March 2006 - 02:18 PM

Hi guys,

I have the follow problem; when I'm at index.php or main.php, I don't want to my include toolbar.php show the [_back_] option.. and ALL my site have this include.

So I think something like this: "If I get my path with the file name, I can test it to check if it's 'index.php' or 'main.php', so, if it's true, i don't show this option."

But.. how can I do it?

I've tryed to search it at function list (php5 documentation), but, don't found nothing..

I'm glad someone may help me! ^-^

Thank you a lot..

D. Soul
(If something is wrong, please tell me. I'm learning this language. Thank you)

#2 Mattyspatty

Mattyspatty
  • Members
  • PipPipPip
  • Advanced Member
  • 76 posts
  • LocationEngland :D

Posted 17 March 2006 - 02:28 PM

$_SERVER['PHP_SELF'] // returns /my_page.php

ok, so my PHP is a bit rusty... my replies are 90% ok.
the other 10% either have syntax errors or are the "hard solution"
http://www.php.net  http://www.google.com - Are your friends!

I have a C++ problem with 'keybd_event' in certain applications. if you can help me PM me! :P
Needs motivation to create another quick cash website. I need a new TV

#3 Darkness Soul

Darkness Soul
  • Members
  • PipPipPip
  • Advanced Member
  • 133 posts
  • LocationBrazil; São Paulo.

Posted 17 March 2006 - 02:49 PM

Thank you!

That's work fine!!!!

$path = pathinfo ( $_SERVER['PHP_SELF'] );
$path = basename ( $path['basename'] , '.php' );
if (( $path != 'index' ) && ( $path != 'main' ))
{
   //code
}

Cya!
(If something is wrong, please tell me. I'm learning this language. Thank you)




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users