-
Notifications
You must be signed in to change notification settings - Fork 0
/
backend.php
44 lines (32 loc) · 1.19 KB
/
backend.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
<?php
require('../php/db_login.php');
//store form inputs
$username = $_POST['username'];
$password = $_POST['password'];
//connect to and query databse
$connect=mysql_connect("$db_host","$db_username","$db_password");
mysql_select_db("$db_database",$connect);
$result=mysql_query('SELECT * from fp_users WHERE username like"'.$username.'" and passwd like "'.$password.'"');
$row=mysql_fetch_array($result);
//conditonal return
If($row){
session_unset();
session_start();
session_register("hello");
$id=session_id();
$_SESSION['sid']=$id;
$_SESSION['user']=$_POST['username'];
//header('Location:http://www.alamedacountycan.org/FinancialProductsv2/fpForm.php');
//echo '<script language="javascript" type="text/javascript">
//window.location="http://www.alamedacountycan.org/FinancialProductsv2/fpForm.php"</script>';
echo '<script language="javascript" type="text/javascript">
window.location="http://sql:85/alamedacountycan/FinancialProductsv2/fpForm.php"</script>';
}
else
{
print "<strong>Incorrect login. Have your registered for this service?</strong>";
}
function redirect(){
header('Location: http://alamedacountycan.org/FinancialProductsv2/fpForm.php');
}
?>