Web Hosting Talk







View Full Version : include file


aoconnor
12-07-2004, 10:28 AM
I have a question:

I am trying to construct an index page that dynamically displays its contents. I have done this repeatedly with webdna, but am trouble doing it with php.

I want to:

if (myvariable is blank) then
show the index content by default
else
show 'myvariable'.inc
endif


The problem is, when a visitor lands on the index page, 'myvariable' is not declared. So what can I do to overcome this.

dirmass
12-08-2004, 12:12 AM
if(!$myvariable) {
include("whatever.php")
} else {
include("else.php")
}

kelvinklay
12-08-2004, 02:17 AM
did the above answered solved your issue ?