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> </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>
Need a fuction to count entries in a field
HiI need a fuction to count how many times a email address is entered in to a field.I making a for wordpress that counts how many timesa user has made comments.Thanks
Limiting uploaded file type
Hi. First post here I am working on a simple upload script, and I need it to limit the allowed file type that is uploaded to only .mpr files. .mpr files are not a MIME file type so I do not know how
SQL Injection
In my attempts to protect my database from mySQL injection I have created another problem for myself....Currently all user inputted strings go through this function;Code: function cleanQuery($string)
Extract text from string
Hi folks,I have a string that looks like this:aaaaaaaaaa: bbbbbbbbbb (ccccccccc) dddddddddddddddddddddeeeeeeeeeeeeeeeeeeeee(format can't be changed - lengths of strings will vary) and I need to
limit string by words??
hello all,I was wonder if there is a function to limit a string by the number of words instead of characters?
Feed Maker
Hi all.First of all I must say I am not a php developer so I am afraid I don't know much about it.I am using the bloging software on my site called Super Simple Blog. This software includes a file
ok i need to join all this pages to make 1 neat code
i have 5 pages that make up my tv guide it works 100% but i want to make it 1 page if i can or 2, i want it to have diff pages for each guide but all the code on 1 page i just dont know how to do it,
Is STL important?
I'm just starting programming and I've made it until the Standart Template Library. But the chapter seems incredibly boring, daunting and complicated, it looks so awful that I haven't yet read it so I
Writing Windows Device Drivers with C
Yes: one of the nice features of C is void*. You can put anything there and get anything out. Very error prone but absolutely brilliant for device drivers.Try
[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 PHP, I have bought a dedicated server, (With unlimited bandwidth of corse, And 2tb Hard drives), And