We are using php 4.0.6 here on a dev server and we are getting a weird
session_start() problem.

After setting up the login on another page, if we register any of our three
required varaibles to go on, the session_start() will simply crash and loop
endlessly. We have tested everything:

- setting values after registering, before registering, not registering at
all and as soon as we register a variable it loops endlessly when we start
the session. Needless to say that we NEED to fix that or else we have a
wonderfull system with no login nor sessions...

here is the code:



function verifypass($login, $password)
 global $sql, $result;
 $req="SELECT  *  FROM giuser WHERE login= '" .  $login  . "' AND password
='" .  md5($password) ."'    ";
 $result=mysql_query($req, $sql);

 if(mysql_num_rows($result) < 1) // le resultat est unique
  return 'Erreur: mot de passe invalide';
 return '';

if($submit == '' || $login == '' || $password == '' || ($moo =
verifypass($login, $password))!='')

 echo '<html><head><title>Gestion des projets</title><meta
http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
    <link href="../css/giprojects.css" rel="stylesheet"
    <body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0"
 echo '<FORM name="loginform" method="post" action="login.php?submit=1">
    <table width="100%" height="100%" border="0" cellpadding="5"
cellspacing="0" class="txt11px">
    <tr> <td><p align="center"><img
src="../images/logo.gif"><br><br><br><br>Nom d\'usager :
    <INPUT name="login" type="text" id="projet25" size="18" maxlength="15"
 if($submit!='' && $login=='') echo '&nbsp; *';
 echo '<br>Mot de passe : <INPUT name="password" type="password" id="login"
size="20" maxlength="15">';
 if($submit!='' && $password=='') echo '&nbsp; *';
 echo '<br><br><a href="#" onClick="document.loginform.submit(); return
    </tr></table><div align="center"></div></body></html>';
 $req="SELECT  *  FROM giuser WHERE login= '" .  $login  . "' AND password
='" .  md5($password) ."'";
 $result=mysql_query($req, $sql);

 if(mysql_num_rows($result) < 1) // le resultat est unique
  include( 'login.php?e=1');
  $row = mysql_fetch_array($result);

  $session_user = $login;
  $session_nomusager = $row[nom];

  echo '<HTML><HEAD><TITLE>GI Projects</TITLE><META http-equiv="refresh"
content="5; URL=todo.php?user=' . $login .'"></HEAD><BODY>';
  $req="SELECT  nom FROM  person WHERE id = ".  $row[personid] ;
  $result = mysql_query($req, $sql);
  $row = mysql_fetch_array($result);
  echo '<center><h3>Bienvenu '.  $row[nom] . '!</h3></center>';
  echo '<center>[niveau d\'access: '. $session_niveauusager . ']'; }


[[[[[[[[[[[[[[[[[[[[[[TODO.PHP]]]]]]]]]]]]]]]]]]]] (File that we get
redirected to after loging in that loops edlessly)

session_start();    //<--------------- JAMS HERE
//include('secur.php'); ?>
<?php include('../includes/open.php'); ?>

<?php //include('../includes/helpers.php');

PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to