snowman15 Posted July 5, 2008 Share Posted July 5, 2008 My code isnt doing anything. It should at least get to either one of the forwards to the other pages but it doesnt get to them. does my code have an error in it? I'm using all php and Mysql 5.0+ Does mysqli have to be turned on to use it or does php mysql 5.0+ have mysqli already active? <?php session_start(); include('db.php'); $user=$_POST['user']; $pass=$_POST['pass']; $sql = 'SELECT * FROM `users` WHERE `user` LIKE CONVERT(_utf8 \''.$user.'\' USING latin1) COLLATE latin1_swedish_ci AND `pass` LIKE CONVERT(_utf8 \''.$pass.'\' USING latin1) COLLATE latin1_swedish_ci'; $result = $db->query($sql); $row = mysqli_fetch_assoc($result); $todaysdate=floor((((time()/60)/60)/24)); if (mysqli_num_rows($result)==0){$_SESSION['error']="Username/Password Not Found "; header('Location: /index.php'); exit;} elseif($row['approved']=="n"){$_SESSION['error']="Your account is not activated. To Reactivate your account, <br>contact me by submitting a question <a href='question.php'>here.</a>"; $_SESSION['question']="Example: Hey I need my account activated. Please send me more information with the email I entered or give me a call at 555-555-5555. Thanks!";header('Location: /index.php'); exit;} elseif(($row['exday']-$todaysdate)<0){$_SESSION['error']="Your account has expired. To add more time, <br>submit a question by clicking on the link below.";header('Location: /index.php'); } else{ //START LOGIN PROCESS $_SESSION['user']="$user"; $_SESSION['name']=$row['fname'].' '.$row['lname']; header('Location: /home.php'); } ?> Quote Link to comment https://forums.phpfreaks.com/topic/113277-solved-php-not-executing-code-error/ Share on other sites More sharing options...
DeanWhitehouse Posted July 5, 2008 Share Posted July 5, 2008 add a die statement to the query to see if it is successfull Quote Link to comment https://forums.phpfreaks.com/topic/113277-solved-php-not-executing-code-error/#findComment-582021 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.