Jump to content

freedominator

New Members
  • Posts

    6
  • Joined

  • Last visited

Everything posted by freedominator

  1. k i tried putting the shit at the top and the session is still destroyed after 1 page load i told u it would make no difference idk y u insist on something that is false <? session_start(); ob_start(); //session_set_cookie_params(3000); ini_set('session.gc_maxlifetime', 6 * 60 * 60); echo "<!DOCTYPE html>"; echo "<script src=\"/javascript/header.js\"></script>"; $session_expiration = time() + 3600 * 24 * 2;
  2. im 99.99% sure the problem is with php.ini or my host, i just need ur help to know what to ask him to change. please check my php.ini http://cksgrill.net/phpinfo.php
  3. thats not true nevermind ill ask somewhere else
  4. the same page is used to log in and check if the user is logged in if the user is logged in, $log is true and the administration page loads if the use is not logged in, he is prompted to log in when testing this, i can log in and use the administration page but if i try to refresh the administration page, the session is gone and i am prompted to log in again
  5. the same page is being used to test if the session is still active
  6. it seems that sessions work when i set them for an instant, and then they are destroyed here is my phpinfo page, can anyone see the problem? i dont have access to the phpini file can u check my cookie settings and tell me if i can use those instead? http://cksgrill.net/phpinfo.php here is the top part of the code which is the relevent part <!DOCTYPE html> <script src="/javascript/header.js"></script> <? session_start(); ob_start(); session_set_cookie_params(3000); ini_set('session.gc_maxlifetime', 6 * 60 * 60); $session_expiration = time() + 3600 * 24 * 2; if((($_POST['name'])and($_POST['password']))or(($_POST['name']!="")and($_POST['password']!=""))) { $_SESSION['name']=$_POST['name']; $_SESSION['password']=$_POST['password']; echo $_SESSION['name']; echo $_POST['name']; echo $_SESSION['password']; echo $_POST['password']; } // redifine variables for different server require_once "mysqlconfig.php"; require_once "textprep.php"; // connect to database global $connection; $connection = mysql_connect(DB_SERVER,DB_USER,DB_PASS); if (!$connection) { die("Database connection failed: " . mysql_error()); } // select database $db_select = mysql_select_db(DB_NAME,$connection); if (!$db_select) { die("Database selection failed: " . mysql_error()); } //check if logged in $result = mysql_query("SELECT * FROM admin"); if (!$result) { die("Database query failed: " . mysql_error()); } // get table names as mysql feedback $i=0; while ($row = mysql_fetch_array($result)) { $name[$i]=$row['name']; $password[$i]=$row['password']; $rank[$i]=$row['rank']; //echo "\$name[$i]=".$row['name']; //echo "\$password[$i]=".$row['password']; //echo "\$rank[$i]=".$row['rank']; $i++; } //check if logged in $log=false; for($j=0;$j<$i;$j++) { //echo "<p>(".$name[$j]."==".$_SESSION['name'].")and(".$password[$j]."==".$_SESSION['password'].")</p>"; if(($name[$j]==$_SESSION['name'])and($password[$j]==$_SESSION['password'])) { $log=true; echo logged." ".$log; } } if($log==true) {
×
×
  • 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.