PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
<?PHP
session_start();
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Admin PAge</title>
</head>
<body>
<?PHP
/*DEfine All or most variables here*/
$you = $_POST['you'];
$me = $_POST['me'];
/*After this is all code*/
if(isset($_POST['Submit'])) {
if(($you == '***') && ($me == '***)) {
$_SESSION['in'] = 1;
echo 'Just making sure my sessions work ';
print_r($_SESSION);
echo 'Welcome to the admin page. This is the basic layout so far.<br>Please use one of the links below to do what you would like to.';
echo '<br>';
echo '<br>';
echo '<a href="http://avi.aerohostale.com/admin/?action=add">Add An Offer</a>';
echo '<br>';
echo '<a href="http://avi.aerohostale.com/admin/?action=view">View Pending and Completed Offers</a>';
echo '<br>';
echo '<a href="http://avi.aerohostale.com/admin/?action=pay">Make a Payment to Someone</a>';
}//closes the password check
}//closes the isset post submit
elseif ($_SESSION['in'] != 1) {
include "actions/login.php";
}
if(isset($_GET['action'])) {
$action= $_GET['action'];
if(($_SESSION['in'] == 1) && (isset($action))) {
switch($action) {
case 'add'://if the link contains add as the action
{
include "/actions/add.php";
}//close the case add
case 'view'://if the action is set to view the payed and unpayed
{
include "/actions/view.php";
}//close the switch $action
}//close the actions if statment
}//close $_SESSION['in'] == 1) && (isset($action)))
}
?>
The problem i am having is that once i clik one of the links that come up when i login:
the sessions i tried before. I seem to always be having session problems. i just want to know why i am having so many session problems. Is there any directive in the php.ini file i can change/look at that i could increase the time for?
i also tried to work around that problem of passing the session by jsut keeping it all onto one page.
<?PHP
session_start();
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Admin PAge</title>
</head>
<body>
<?PHP
/*DEfine All or most variables here*/
$you = $_POST['you'];
$me = $_POST['me'];
/*After this is all code*/
if(isset($_POST['Submit'])) {
if(($you == '***') && ($me == '***')) {
$_SESSION['in'] = 1;
echo 'Just making sure my sessions work ';
print_r($_SESSION);
echo 'Welcome to the admin page. This is the basic layout so far.<br>Please use one of the links below to do what you would like to.';
echo '<br>';
echo '<br>';
echo '<a href="http://avi.aerohostale.com/admin/?action=add">Add An Offer</a>';
echo '<br>';
echo '<a href="http://avi.aerohostale.com/admin/?action=view">View Pending and Completed Offers</a>';
echo '<br>';
echo '<a href="http://avi.aerohostale.com/admin/?action=pay">Make a Payment to Someone</a>';
}//closes the password check
}//closes the isset post submit
elseif ($_SESSION['in'] != 1) {
include "actions/login.php";
}
if(isset($_GET['action'])) {
$action= $_GET['action'];
if(($_SESSION['in'] == 1) && (isset($action))) {
switch($action) {
case 'add'://if the link contains add as the action
{
include "/actions/add.php";
}//close the case add
case 'view'://if the action is set to view the payed and unpayed
{
include "/actions/view.php";
}//close the switch $action
}//close the actions if statment
}//close $_SESSION['in'] == 1) && (isset($action)))
}
?>