AJAXBot/www/conn_generic.php

22 lines
612 B
PHP
Raw Permalink Normal View History

2014-06-16 21:25:59 +00:00
<?php
mysql_connect("HOSTADDRESS", "USERNAME", "PASSWORD");
mysql_select_db("DATABASE_NAME");
session_start();
2014-07-09 22:00:12 +00:00
$config = mysql_fetch_object(mysql_query("SELECT * FROM `config` WHERE `id`=1"));
function escapeDoubleQuotes($str) {
return str_replace('"','\\"',$str);
}
function escapeSingleQuotes($str) {
return str_replace("'","\\'",$str);
}
2014-07-09 22:00:12 +00:00
function checkIfLoggedIn() {
if(mysql_num_rows(mysql_query("SELECT * FROM `admin` WHERE `username`='". mysql_real_escape_string($_SESSION['user']) ."' AND `password`='". $_SESSION['pwd'] ."'")) > 0)
return true;
else
return false;
}
2014-06-16 21:25:59 +00:00
?>