Jump to content

Another problem, this time- sessions :<


Yuval200

Recommended Posts

Hello again guys :)This time I have a PHP problem regarding sessions. So basicly I have three pages, one is cplogin.php that works fine and isn't relavent, get.php and admincp.php. This is get.php:

<?php	include_once("data.php");	if ($form_name && $form_content != "") {		mysql_query("INSERT INTO posts (post_sender, post_content, post_date, post_id) VALUES ('$form_name', '$form_content', '$form_date', NULL)", yp_mysql_connect);		header("Location: main.php?page=outpost");	}		elseif ($cplogin != "") {		if ($cplogin == "****") {			session_start();			$_SESSION['cpacaccess'] = 'true';			header("Location: main.php?page=admincp");		}				else			header("Location: main.php?page=cplogin&error=true");	}		else		header("Location: main.php");?>

I censored the pass if you don't mind..and admincp.php:

<?php if (isset($_SESSION['cpacaccess']))		echo <<< END		<div id="container">Hello		</div>END;else echo "2";?>

The header redirects fine, the problem is with the session, it didn't echoed a thing, so I add the else part, and it echoed "2", so the session is not set. Why?Thanks in advance :)

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...