0byt3m1n1
Path:
/
data
/
17
/
1
/
18
/
11
/
1670011
/
user
/
1801231
/
htdocs
/
customtanningbed_dot_com_bc
/
admin
/
[
Home
]
File: log_tan.php
<?php session_start(); if(empty($_REQUEST['username']) && empty($_REQUEST['password'])) { $m="<center><h2><font color='red'>Enter valid username and password</font></h2></center>"; include("index.php"); exit; } try { $dbh = new PDO("mysql:host=205.178.146.73;dbname=custombed","custombed","andyMc2009"); $dbh->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); // <== add this line $sql = $dbh->prepare("select * from `tanningonline_login` where `username`= :username and `password`= :passw LIMIT 1"); $sql->execute( array(':username' => $_REQUEST['username'], ':passw' => $_REQUEST['password']) ); $count = $sql->rowCount(); if( $count > 0 ) { $sid=session_id(); session_register($sid); $sql1 = $dbh->prepare("update `tanningonline_login` set `session`=:sid where `username`=:username"); $sql1->execute( array(':username' => $_REQUEST['username'], ':sid' => $sid) ); $_SESSION['admin']=1; $a=$_REQUEST['username']; include("welcome.php"); } else { $m="Enter valid username and password"; include("index.php"); } $dbh = null; } catch(PDOException $e) { echo $e->getMessage(); } ?>