now, i’m trying to write program using php and sqlite, but i have problem. browser shows error to me, can u help me to correct my program? this is the sourcecode
<?php
$user_id = $_POST["user_id"];
$pass_id = $_POST["pass_id"];
$database = sqlite_open("database_support/user_acces...");
$result = sqlite_query($database, "select * from user_table where user_id like '$user_id' and pass_id like '$pass_id'");
if($result){
$_SESSION["user_id"] = $user_id;
$_SESSION["pass_id"] = $pass_id;
$_SESSION["time_id"] = time() + 10;
echo ($_SESSION["time_id"]);
}
else{
header("location:index.php");
}
?>
result from chrome browser :
Warning: sqlite_open() [function.sqlite-open]: unable to open database: C:\xampp\htdocs\aptana\gsy\document_supp… in C:\xampp\htdocs\aptana\gsy\document_supp… on line 5 Warning: sqlite_query() expects parameter 1 to be resource, string given in C:\xampp\htdocs\aptana\gsy\document_supp… on line 6 Warning: Cannot modify header information - headers already sent by (output started at C:\xampp\htdocs\aptana\gsy\document_supp… in C:\xampp\htdocs\aptana\gsy\document_supp… on line 15
can anybody help me,? thanks 4 ur time,
Your sqllite_open should be like below code. in your code it seems something lacking.
If you want to use session in any file then you have to start session before use it
So your code must be like this sample code.