Hi all, i attempted to create a whole new login script witch isnt working for some reason i dont know why. When i put the users details and then press submit, it just refreshes the page, even when i put the wrong details in it still does the same..
<?php
session_start();
include_once"config.php";
if (strip_tags($_GET['logout']) == "yes"){
session_destroy();
}elseif (isset($_SESSION['username'])){
header("Location: index2.php");
exit();
}
if ($_POST['Submit'] && strip_tags($_POST['username']) && strip_tags($_POST['password'])){
$username = addslashes(strip_tags($_POST['username']));
$password = addslashes(strip_tags($_POST['password']));
$ip = $REMOTE_ADDR;
///check INFO
$sql = mysql_query("SELECT * FROM allmembers WHERE username='$username' AND password='$password' LIMIT 1");
$login_check = mysql_num_rows($sql);
$inf = mysql_fetch_object($sql);
if ($login_check == "0"){
$message="You could not be logged in";
}elseif ($login_check != "0"){
if ($login_check > "0"){
if ($inf->status == "Dead"){
include_once"dead.php";
exit();
}
if ($inf->status == "Banned"){
$encoded=md5(strtolower($username));
header("Location: banned.php?banned=$username&encoded=$encoded");
exit();
}
session_register('username');
$_SESSION['username'] = $inf->username;
$timestamp = time()+60;
mysql_query("UPDATE allmembers SET online='$timestamp' WHERE username='$username'");
mysql_query("UPDATE allmembers SET l_ip='$ip' WHERE username='$username'");
header("Location: members.php");
} else {
$message= "You could not be logged in.<br />";
}}}
$total_regged=mysql_num_rows(mysql_query("SELECT * FROM allmembers"));
$admins=mysql_num_rows(mysql_query("SELECT * FROM allmembers WHERE userlevel='2'"));
$mods=mysql_num_rows(mysql_query("SELECT * FROM allmembers WHERE userlevel='1'"));
$iti=mysql_fetch_object(mysql_query("SELECT * FROM site_stats WHERE id='1'"));
$most=$iti->online;
?>
Thats all the php code for my login system.
Thanks for your help.
Php script to read msword file
hi,I need to read a msword file and i want to print the contents in that word file.i used the fgets() and its working for text file. but its not working for word file.Help me in this.Thanks
help countdown timers
hello every one,I'd like to know how to insert many countdowns in the same page.The duration of each must be different and defined by members with a form.
getting weird error..
okay, I'm getting an error on this particular function, something about the syntax in the mysql LIMIT statement, but as far as I can see I have it right, currently using easymysql3.0 as test server,
update post issues
I am trying to create an update to a post function, while the update does occur, the page routing and selecting of posts to be updated is whats getting screwed up. I have so many files involved in
Remove directories not empty
hi,i have an array that contains some names (1,4,6,56...). Every integer is a name of a folder.I must to delete only the folders in array, i use this code:Code: $all_folders = array();while ($row =
Getting Resource id #11 while trying to connect..
So i tried using "DEFINE" for the first time and im using the variables i defined to connect but it reports back this error:QuoteWarning: mysql_query(): 11 is not a valid MySQL-Link resource
Big O & time complexity ???
can you help me how to calculate the Big O & time complexity for any algorithm and c++ program please?
Functions Not Loading Into Div
I had some help doing some of this but what I'm trying to do is get my functions to retrieve its values from the backstagefunctions.php file and place the contents in the content div but when you
Two warning messages
Quote<b>Warning</b>: mysql_real_escape_string() expects parameter 1 to be string, array given in
Using two $_POST Function / Switch () statements, second does not work.
Hi all. I’m new to php and am having a problem getting $_POST Function / switch () to work. I am coding a registration form. I ask the user a Yes/No question. Depending on the answer I have an