Hi,
ok this is a long one. i have created a password protection web page using asp. i have just found out that the web server does not support asp but do support php. so i am trying to convert the page to php. i am having a few problems. the page is trying to access a ms access database.
this is the code i have currently to which there is a problem in it.
<html>
<head>
<title>login.php3</title>
</head>
<body>
<SCRIPT language ="php">
$UserName=$HTTP_POST_VARS["username"];
$Password=$HTTP_POST_VARS["password"];
$MyConn=odbc_connect("
$SQL="Select UserName, Password From tblLogin
_,Where UserName=$UserName,Password=$Password";
$RS_query=odbc_exec($MyConn,($SQL));
$RS_ptr=1;
$RS=odbc_fetch_row($RS_query,$RS_ptr++);
if (!($RS==0))
{
$allow_session=true;
header("Location: "."Default.htm"
exit;
}
else
{
header("Location: "."main.htm"
exit;
odbc_close($MyConn);
$RS=null;
$MyConn=null;
}
</script>
</html>
the problem seems to be with the $SQL statement and the $MyConn=odbc_connect..... statement. the errors that i am getting is as follows
Warning: Wrong parameter count for odbc_connect() in C:\Inetpub\ on line 11
Warning: Supplied argument is not a valid ODBC-Link resource in C:\Inetpub\ on line 16
Warning: Supplied argument is not a valid ODBC result resource in C:\Inetpub\ on line 18
Warning: Cannot add header information - headers already sent by (output started at C:\Inetpub\ in C:\Inetpub\ on line 31
does anyone have any ideas as to where i am going wrong. any help would be great.
Regards
Rose
ok this is a long one. i have created a password protection web page using asp. i have just found out that the web server does not support asp but do support php. so i am trying to convert the page to php. i am having a few problems. the page is trying to access a ms access database.
this is the code i have currently to which there is a problem in it.
<html>
<head>
<title>login.php3</title>
</head>
<body>
<SCRIPT language ="php">
$UserName=$HTTP_POST_VARS["username"];
$Password=$HTTP_POST_VARS["password"];
$MyConn=odbc_connect("
$SQL="Select UserName, Password From tblLogin
_,Where UserName=$UserName,Password=$Password";
$RS_query=odbc_exec($MyConn,($SQL));
$RS_ptr=1;
$RS=odbc_fetch_row($RS_query,$RS_ptr++);
if (!($RS==0))
{
$allow_session=true;
header("Location: "."Default.htm"
exit;
}
else
{
header("Location: "."main.htm"
exit;
odbc_close($MyConn);
$RS=null;
$MyConn=null;
}
</script>
</html>
the problem seems to be with the $SQL statement and the $MyConn=odbc_connect..... statement. the errors that i am getting is as follows
Warning: Wrong parameter count for odbc_connect() in C:\Inetpub\ on line 11
Warning: Supplied argument is not a valid ODBC-Link resource in C:\Inetpub\ on line 16
Warning: Supplied argument is not a valid ODBC result resource in C:\Inetpub\ on line 18
Warning: Cannot add header information - headers already sent by (output started at C:\Inetpub\ in C:\Inetpub\ on line 31
does anyone have any ideas as to where i am going wrong. any help would be great.
Regards
Rose