Jump to content

confirm problem


ki

Recommended Posts

okay what im trying to do is check is 3 variables posted match 3 variables that are in the same mysql db row

<? ob_start(); ?>
<?
require_once('config.php');
$user = $_GET['u'];
$pass = $_GET['p'];
$serial = $_GET['s'];

$q = mysql_query("SELECT * FROM `usr_db` WHERE `users` = '".$user."' AND `password` = '".$pass."' AND `serial` = '".$serial."'");
$q2 = mysql_fetch_object($q);
if(!$user) { die('0'); }
if(!$pass) { die('0'); }
if(!$serial) { die('0'); }
if(!$q2) { die('0'); } else { die('1'); }
if(($q2->users == $user) && ($q2->password == $pass) && ($q2->serial == $serial)) { die('1'); }
?>

 

thats my code im using the $_GET function because im using it on a VB6 program, If it fails I want it to return a 0 if it all passes I want it to return a 1, but somethings wrong and I don't know what, help would be appreciated.

Link to comment
Share on other sites

<? ob_start(); ?>
<?
require_once('config.php');
$user = $_GET['u'];
$pass = $_GET['p'];
$serial = $_GET['s'];

$q = mysql_query("SELECT * FROM `usr_db` WHERE `users` = '".$user."' AND `password` = '".$pass."' AND `serial` = '".$serial."'");
$number = mysql_num_rows($q);
if($number == 0) {echo "0";} else {echo "1";}
?>

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.