if ($poll12) {
setcookie("poll12","555", time() + 1209600);
}
//--------------------------------------------------------------
$dbconnect = mysql_connect("heyppl_db","heyppl_db","anna5643");
if (!$dbconnect) {
echo ("
Unable to connect to database");
}
$dbselect = @mysql_select_db("heyppl_db");
//--------------------------------------------------------------
$refer = $HTTP_REFERER;
$url = getenv("REQUEST_URI");
$browser = $HTTP_USER_AGENT;
$ip = $REMOTE_ADDR;
if ($url !== '/multimania/fr/heyppl/hits.php3') {
$query = @mysql_query("INSERT INTO visitors (time, referer, browser, ip, page) VALUES (now(),'$refer','$browser','$ip','$url');");
}
if ($id) {
$query = mysql_query("SELECT username,password FROM users WHERE id='$id'");
while ($row = mysql_fetch_array($query)) {
$password = $row[password];
$username = $row[username];
}
}
if ($signout) {
setcookie("id");
$username = "";
$password = 0;
$signout = 0;
$id = "";
}
if (!$username and !$password) {
$nothing = "true";
}
if (!$signout) {
if ($id !== '') {
$password = md5($password);
}
if ($username) {
$query = mysql_query("SELECT id,username,password FROM users");
while ($row = mysql_fetch_array($query)) {
if (!strcasecmp($username,$row[username])) {
if (!strcasecmp($password,$row[password])) {
$id = $row[id];
if ($permanent) {
$id = $row[id];
setcookie("id", "$id", time() + 1209600);
}
}
Else {
$nousername = "true";
}
}
Else {
$nopassword = "true";
}
}
}
}
include("head.php");
if (!$page) {
include("main.php3");
}
elseif ($page == "main") {
include("main.php3");
}
elseif ($page == "editfile") {
//PHP script
//begin file editing script
//------------------------------
if ($done) {
$admin = mysql_query("SELECT admin FROM users WHERE ID='$id'");
$admin2 = mysql_result($admin,0);
if (!strpos($admin2,"A")) {
echo ("You do not have the correct permissions to access this page");
exit(include("bottom.php3"));
}
$contents = str_replace("[b]", "", $contents);
$contents = str_replace("[/b]", "", $contents);
$contents = str_replace("[u]", "", $contents);
$contents = str_replace("[/u]", "", $contents);
$contents = str_replace("
", "
", $contents);
$file = fopen($filename,"w");
$write = fputs($file , $contents, strlen($contents));
fclose($file);
echo (" File written to \"") . $contents . ("\"");
}
echo ("