I am lost..
Posted: Fri Apr 02, 2004 2:58 pm
Oke all works the db insert and all that.. however below i got 2 examples ..
AT the first i thought this had somehting to do with my db connecting but .. seems it didnt.
1st works fine ( without the if statements )
2nd doesnt anymore.. ( with the if .. )
2nd with the if statement doesn work..
AT the first i thought this had somehting to do with my db connecting but .. seems it didnt.
1st works fine ( without the if statements )
2nd doesnt anymore.. ( with the if .. )
Code: Select all
if (isset($_COOKIE['USERNAME']) && isset($_COOKIE['PASSWORD']))
{
// Get values from superglobal variables
$USERNAME = $_COOKIE['USERNAME'];
$PASSWORD = $_COOKIE['PASSWORD'];
$date = ("m.d.y");
$host = "10.10.10.5:1433";
$usr = "sa";
$pwd = "sa";
$msdb = "tms";
$mstb = "upload";
$connect = @mssql_connect($host, $usr, $pwd)
or die ("Coudnt connect to the mssql, please contact the site administrator immediatly");
$select = @mssql_select_db($msdb, $connect)
or die ("Couldnt select the ms db, please contact the site administrator immediatly");
$email = ('blah@blah.com');
$codigo_operador = '1';
$clave = '2';
$query = "INSERT INTO upload (username, email, codigo_operador, clave)
VALUES ('$USERNAME', '$email', '$codigo_operador', '$clave')";
if (mssql_query ($query, $connect))
{
echo ("");
}
$CheckSecurity = new auth();
$check = $CheckSecurity->page_check($USERNAME, $PASSWORD);
}
else
{
$check = false;
}
if ($check == false)
{
.. and a little more.. which works fine..Code: Select all
if (isset($_COOKIE['USERNAME']) && isset($_COOKIE['PASSWORD']))
{
// Get values from superglobal variables
$USERNAME = $_COOKIE['USERNAME'];
$PASSWORD = $_COOKIE['PASSWORD'];
$date = ("m.d.y");
$host = "10.10.10.5:1433";
$usr = "sa";
$pwd = "sa";
$msdb = "tms";
$mstb = "upload";
$connect = @mssql_connect($host, $usr, $pwd)
or die ("Coudnt connect to the mssql, please contact the site administrator immediatly");
$select = @mssql_select_db($msdb, $connect)
or die ("Couldnt select the ms db, please contact the site administrator immediatly");
if ($username == 'test') {
$email = ('blah@blah.com');
$codigo_operador = '1';
$clave = '2';
$query = "INSERT INTO upload (username, email, codigo_operador, clave)
VALUES ('$USERNAME', '$email', '$codigo_operador', '$clave')";
if (mssql_query ($query, $connect))
{
echo ("");
}
}
if ($username == 'test1') {
$email = ('blah@blah2.com');
$codigo_operador = '3';
$clave = '3';
$query = "INSERT INTO upload (username, email, codigo_operador, clave)
VALUES ('$USERNAME', '$email', '$codigo_operador', '$clave')";
if (mssql_query ($query, $connect))
{
echo ("");
}
}
$CheckSecurity = new auth();
$check = $CheckSecurity->page_check($USERNAME, $PASSWORD);
}
else
{
$check = false;
}
if ($check == false)
{
and all the other..