01.
<?
02.
include
(
"con_booksal.php"
);
03.
$user
=
$_GET
[user];
04.
$pass
=
$_GET
[pass];
05.
$check
=
$_GET
[check];
06.
$sql
=
"select * from customer where cuser='$user' and cpwd='$pass'"
;
07.
$result
= mysql_query (
$sql
,
$conndb
);
08.
if
(
$row
= mysql_fetch_array (
$result
)){
09.
if
(
$check
==
"cookies"
){
10.
echo
$check
;
11.
setcookie(
"username"
,
$user
,time()+3600*24*356);
12.
setcookie(
"password"
,
$pass
,time()+3600*24*356);
13.
echo
"Welcome "
.
$_COOKIE
[
"username"
] .
"!<br />"
;
14.
echo
$check
;
15.
}
else
if
(
$check
==
"session"
){
16.
echo
$check
;
17.
}
18.
}
else
{
19.
echo
"false"
;
20.
}
21.
?>