By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,460 Members | 1,181 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,460 IT Pros & Developers. It's quick & easy.

Can't include page on another php page

P: 106

I want to include a php page if the url as the variable ?logout

My objective is to show a page (logout-message.php) once user logouts (he goes automatically to

Please note that the logout-message.php page contains a frame, so want I want is to display that frame over the index page (

Here's what I have:

Expand|Select|Wrap|Line Numbers
  1. <?php
  2. if(isset($_GET['logout']))
  3. include("logout-message.php");
  4. ?>
The code above is on the index page.

The problem I'm encountering is that the php include seems to take away all the rest of the page. When i navigate to I see only the content of the logout-message.php page, the content of the index page is gone!

I'd appreciate your help, thanks in advance.

If you know of an easier way to do want I want, like i.e. something like php if .... (same as above) .. display content of another page.. i don't know... i'm a newbie on php..

What I want is to display the content of an external page (over the already existing index page) if the url has ?logout.

thank You.
May 5 '10 #1
Share this Question
Share on Google+
1 Reply

Expert 100+
P: 1,584
Where is that php code snip you pasted above? is it in index.php or?

Don't know the layout of your page, but your code should work if it's in the proper place.

Let's see your entire code.

May 5 '10 #2

Post your reply

Sign in to post your reply or Sign up for a free account.