Page 1 of 1

How can I 'else inlude' a file

Posted: Fri May 29, 2009 5:44 pm
by mikes1471
Hi Everyone

In the same way I can use 'else' to display one of these two statements:

Code: Select all

if (isset($_SESSION['user']))
                    {
                        echo "This text";
                    }
                    else include("loginarea.php");
                    {
                    echo "This text instead"
                    }
Could someone please tell me how I can make an

Code: Select all

else include "thisfile.php"

Re: How can I 'else inlude' a file

Posted: Fri May 29, 2009 7:06 pm
by califdon

Re: How can I 'else inlude' a file

Posted: Fri May 29, 2009 8:57 pm
by mikemike
You seem to be confusing some basic principles here. I suggest doing some basic tutorials, probably best starting with the PHP.net one: http://uk.php.net/tut