Jump to content

Wha.... the heck


jkewlo

Recommended Posts

when i display the data with

<?
session_start();

$email = @$_POST['email'];
$password = @$_POST['password'];

$conn = new COM('ADODB.Connection') or die('Could not make conn');
$rs = new COM('ADODB.Recordset') or die('Coult not make rs');

$connstring = "Provider=Microsoft.Jet.OLEDB.4.0; Data Source=c:\\wamp\\www\\pro\\project\\Rainwater.mdb";


$conn->Open($connstring);
if (!$conn)
  {exit("Connection Failed: " . $conn);}
$sql="SELECT email, password
FROM sign
WHERE email = '$email' AND password = '$password' 
";
$rs->Open($sql, $conn);

if(odbc_num_rows($rs) != 1){
echo "". $email ." & ". $password .""; 
}
?>

i get

 

Warning: odbc_num_rows(): supplied argument is not a valid ODBC result resource in C:\wamp\www\pro\project\check.php on line 22

[email protected] & 123

 

as a error but as u can see it is printing

 

the email and password

 

what would be the odbc way of getting the num_rows?

i just need to make a log in page work. anything would be good as long as it checks against the email and password.

 

please need help running out of time

Link to comment
https://forums.phpfreaks.com/topic/97131-wha-the-heck/page/2/#findComment-497171
Share on other sites

gawd finially got it.

 

for future reference

 

<?
session_start();

$email = @$_POST['email'];
$password = @$_POST['password'];

$conn = new COM('ADODB.Connection') or die('Could not make conn');
$rs = new COM('ADODB.Recordset') or die('Coult not make rs');

$connstring = "Provider=Microsoft.Jet.OLEDB.4.0; Data Source=c:\\wamp\\www\\pro\\project\\Rainwater.mdb";


$conn->Open($connstring);
if (!$conn)
  {exit("Connection Failed: " . $conn);}
$sql="SELECT email, password
FROM sign
WHERE email = '$email' AND password = '$password' 
";
$rs->Open($sql, $conn);

if (!$rs->EOF)
{
if ( $rs->Fields["email"]->value
&& $rs->Fields["email"]->value == $email
&& $rs->Fields["Password"]->value
&& $rs->Fields["Password"]->value == $password
)
{
$_SESSION["auth"] = $email;
// Relocate to the logged-in page
header("Location: profile.php");
}
}
else
{
$_SESSION["message"] = "login Error as $email. " ;
header("Location: sign_in.php");
} 
?>

Link to comment
https://forums.phpfreaks.com/topic/97131-wha-the-heck/page/2/#findComment-497186
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.