Jump to content

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
This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.