my login script page is not working on remote computers


Posted on 16th Feb 2014 07:03 pm by admin

hi my login is working on my computer, but when i tried 2 computers from 2 different locations, they couldnt login. any help greatly appreciated. thanks. derek.
its setting the hack variable to Y on remote computers.

here is the code for the login page.

Code: <?php
include("connect1.php");

session_start();
$u = $_POST['username'];
$p = $_POST['password'];
$logoff = $_GET['logoff'];
$hack = $_GET['hack'];






if($logoff){


unset($_SESSION['userid']);



$message = "You have been logged off";




}


if($hack){

$message = "Naughty Naughty! "; // COOL

}


// escape username and password for use in SQL//person said on board "looks fine" like this
//to prevent sql injections
$u = mysql_real_escape_string($u);
$p = mysql_real_escape_string($p);


// if fields username and password have contents, then...
if(isset($u) && isset($p) && !empty($u) && !empty($p)){ ///changed from if ($u && $p)

$query = mysql_query("SELECT * FROM table2 WHERE username = '$u' AND password = '$p'");

$result = mysql_fetch_array($query);


if($result['username']){ // if username is set, go on...username is a key for $result, and a field in the table.

$message = "You have been logged in";


$_SESSION['userid'] = $result['username'];

header("Location:old.mainsite.php"); // this will redirect them to the application.php page. and exit the script here.
exit;


}else{

$message = "You do not exist on the system";

}



}
?>
<?php
//IP BANNING CODE START HERE
$s=$_SERVER["REMOTE_ADDR"];
//draws IP address of visitor
$ipbancheck="SELECT * from banip where IP='$s'";
$ipbancheck2=mysql_query($ipbancheck);
while($ipbancheck3=mysql_fetch_array($ipbancheck2))
{
$IPBANNED=$ipbancheck3[IP];
}
//above lines check to see if user Ip is in banned IPs
if ($IPBANNED)
{
header('Location: http://derekvanderven.com/hacker.html');
//print "You have been banned ";

}
else
{

}
?>

here is the code for the form

Code: <form id="form1" name="form1" method="post" action="">
<p>&nbsp;</p>
<table width="200" border="1" align="center">
<tr>
<td><span class="style2">Login to the secret pages</span></td>
</tr>
<tr>
<td><label for="username"> User name </label>
<input type="text" name="username" id="username" /></td>
</tr>
<tr>
<td><label for="password"> Password </label>
<input type="password" name="password" id="password" /></td>
</tr>
<tr>
<td height="44"><input type="submit" name="submit" id="submit" value="Submit" /></td>
</tr>
</table>
</form>

346 Like 10 Dislike
Previous php-forum Next php-forum
Other php-forum

php unable to sent email
Hi, guys, I try to send a email through php but unfortunately the mail unable to sent. Here is my co

mail() says sent but no email received
My code is quite simple:

Code: <?php
$to = "Ty44ler@yahoo.com";
$subje

[newb] Image hosting help.
Hey there, I'm new to php, I know some basics and i can code PWN, I'm only 14 but I'm interested in

Echo-ing MySQL content and Keep Formatting?
I have data in my MySQL such as:

QuoteBlah blah

Blah blah

etc
but when i ech

If a record matches an existing record do nothing
So I don't know if I should put this here or in mysql, but what my script is for is for people to ad

removing space from the end of a variable
i have a variable $image which contains the following url "http://tiles.xbox.com/tiles/oo/P5/0m

CURL XML Request [From C to PHP]
Hi,

I need some help converting this into something that will work with PHP.

Code: #

sendmail code suddenly not working
Hi Guys, I maintain 3 sites (including my own) I use the following code from a french webmaster that

php web service error
hey guys,
I'm working on a project requires the use of web services. I've been trying a few tutor

Help with file_get_html
The following code gives the expected results:

<html>
<head&g

Sign up to write
Sign up now if you have flare of writing..
Login   |   Register
Follow Us
Indyaspeak @ Facebook Indyaspeak @ Twitter Indyaspeak @ Pinterest RSS



Play Free Quiz and Win Cash