Re: Question on conditional statement



On Nov 27, 6:29 am, Paul Herber
<SubstituteMyFirstNameH...@xxxxxxxxxxx> wrote:
On Wed, 26 Nov 2008 18:02:02 -0800 (PST), rbaul...@xxxxxxxxxxx wrote:
Hello -

If anyone could field the following question, I'd greatly appreciate
it:

This seems to be a simple question, but for some reason it's not
working in the code I'm working with...
I'm very new to PHP...

I'd like to simply test whether or not the current web page is the
home page, and then execute one line of code, such as <div
class=class1>; if not, execute <div class=class2>.  I've tried various
incarnations of is_home(), but the page displays nothing.  Can anyone
shoot me some code that will work? :)

$path = $_SERVER['PHP_SELF'];
$basename = basename($path, ".php");
if ($basename == 'index') {

}

--
Regards, Paul Herber, Sandrila Ltd.
Unicode characters              http://www.diacrit.sandrila..co.uk/

Paul -

That's exactly what I was looking for. Worked perfectly... Thank
you :)
.