Jump to content

[SOLVED] php not executing code: error?


snowman15

Recommended Posts

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');
}
?>

Link to comment
https://forums.phpfreaks.com/topic/113277-solved-php-not-executing-code-error/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.