qutazs
06-28-2010, 07:26 PM
Hello,
i'm trying to make a php script, which will check to see if a certain "code" is matching a code in my MySQL database.
Im trying to make a killswitch, and this is part of it.
<? include('connect.php'); ?>
<?
if ($ks == '12qwaszx!"QWASZX')
print("Website is live - Killswitch is OFF");
else
print("Killswitch is ON!");
?>
the $ks should get the value from the MySQL db, and then check if the one written beside it is the same.
If it is! It should show "Website is live - Killswitch if OFF".
Otherwise it should show: "Killswitch is ON!"
The content of my connect.php is:
<?
$host = 'HIDDEN';
$user = 'HIDDEN';
$pass = 'HIDDEN';
$db = 'HIDDEN';
// The database connect part
mysql_connect("$host", "$user", "$pass") or die(mysql_error());
mysql_select_db("$db") or die(mysql_error());
// Fetch Stuff
$q = "SELECT * FROM killswitch";
$result = mysql_query($q) or die(mysql_error());
?>
i'm trying to make a php script, which will check to see if a certain "code" is matching a code in my MySQL database.
Im trying to make a killswitch, and this is part of it.
<? include('connect.php'); ?>
<?
if ($ks == '12qwaszx!"QWASZX')
print("Website is live - Killswitch is OFF");
else
print("Killswitch is ON!");
?>
the $ks should get the value from the MySQL db, and then check if the one written beside it is the same.
If it is! It should show "Website is live - Killswitch if OFF".
Otherwise it should show: "Killswitch is ON!"
The content of my connect.php is:
<?
$host = 'HIDDEN';
$user = 'HIDDEN';
$pass = 'HIDDEN';
$db = 'HIDDEN';
// The database connect part
mysql_connect("$host", "$user", "$pass") or die(mysql_error());
mysql_select_db("$db") or die(mysql_error());
// Fetch Stuff
$q = "SELECT * FROM killswitch";
$result = mysql_query($q) or die(mysql_error());
?>