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

yuki_mimilam@hotmail.com & 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
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
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.