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
https://forums.phpfreaks.com/topic/61120-confirm-problem/
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
https://forums.phpfreaks.com/topic/61120-confirm-problem/#findComment-304158
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.