How can I 'else inlude' a file

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
mikes1471
Forum Commoner
Posts: 88
Joined: Sat Jan 24, 2009 3:29 pm

How can I 'else inlude' a file

Post 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"
User avatar
califdon
Jack of Zircons
Posts: 4484
Joined: Thu Nov 09, 2006 8:30 pm
Location: California, USA

Re: How can I 'else inlude' a file

Post by califdon »

User avatar
mikemike
Forum Contributor
Posts: 355
Joined: Sun May 24, 2009 5:37 pm
Location: Chester, UK

Re: How can I 'else inlude' a file

Post 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
Post Reply