Jump to content

PHP Navigation (index.php?view=....)


Andrew R

Recommended Posts

I need some help on creating a PHP navigation script that uses the home page (index.php) as a template for the other pages on the site.  I know plenty of scripts that will give me, index.php?view=home, but I can’t get them to work without getting errors if I’m using sessions on my page, i.e. for a login or a user area.  Anybody know any scripts that will allow me to use a PHP Navigation and sessions (session_start();) etc?

Here’s the current script I’m using to get
[code]<?
$content = $_REQUEST['view'];
if($view == "") {
$view = "home";
}
?>[/code]

[code]<?
include "$view.php"; ?>[/code]

Cheers.
Link to comment
https://forums.phpfreaks.com/topic/17784-php-navigation-indexphpview/
Share on other sites

Cheers "sasa"

The errors I'm repeatedly getting are, Warning: session_start(): Cannot send session cookie - headers already sent by (output started at ................).

I have been reading around on this forum and I believe the session_start() has to be on the index page although I’m not sure if I do this it will make my site less secure?

I’m also getting problems submitting forms with $_SERVER['PHP_SELF'] using index.php?view=….  Any idea on how to submit forms using $_SERVER['PHP_SELF'] with the php navigation I'm using?

Help would be much appreciated

Cheers

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.