If you are not registered or logged in, you may still use these forums but with limited features. Show recent topics
  [Search] Search   [Hottest Topics] Hottest Topics   [Members]  Member Listing   [FAQ]  FAQ 
[Register] Register / 
[Login] Login 
PHP Including  XML
Forum Index » Support Forum
Author Message
Maverik
Newbie

Joined: 04/03/2002 23:41:39
Messages: 2
Offline

I use php includes:
if(!$page & !$id) {
include("http://www.url.com/main.php");
}
else{
include("http://www.url.com/" . "$id" . "/" . "$page" . ".php");
}

So when someone types: http://www.url.com/index.php?page=whatever, it inlcudes the whatever.php file into wherever this code is placed on the index.php file. This makes it easy to update the navigation, as in a sense, there is only one page with a navigation bar on it.

Anyway, when using this method, the page that the poll is on, say poll.php, whenever someone votes, or clicks get results, it brings them to polls.php?action=on and on...

This loads ONLY the polls.php file into the browser, not the index.php file. Which is annoying. Is there any way to fix this? To see what I'm talking about:

http://www.goldnsun.net/test


P.S. When someone clicks on the Vote button, it generates some sort of error. Though, it counts the vote and such, but it returns this:

Warning: Cannot add header information - headers already sent by (output started at /URL to main file:8) in /URL to cookie/polls/poll_cookie.php on line 21
[Email]
O.C.
Beginner

Joined: 04/03/2002 02:14:19
Messages: 10
Offline

Make sure that the page your poll is embedded in has the
<?php require "poll_cookie.php"; ?>
tag before anything else.

That solved it for me.
Maverik
Newbie

Joined: 04/03/2002 23:41:39
Messages: 2
Offline

That cleared the warning error, but what about the including part. why does it only show the main.php file, rather then the main.php included IN the index.php

I used a inline frame to clear it now, but that means it won't work with Netscape, and it doesn't look good anyway. this is just a temporary fix, does anyone have a permenant fix?
[Email]
 
Forum Index » Support Forum
Go to:   
Based on the open source JForum