Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

PHP Forum


You are currently viewing our PHP Forum as a guest. Please register to participate.
Login



Freelance Jobs

Reply
my login script page is not working on remote computers
Old 11-05-2009, 07:26 PM my login script page is not working on remote computers
Webmaster Talker

Posts: 611
Trades: 0
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 other computers.also, could someone check my paypal button on my website http://oddnerdrum.com the button is at the bottom and i cant get it to work with internet explorer 6. please let me know if it works for you on internet explorer 6 or other versions.

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
{
 
}
?>
and here is the code to my 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>

Last edited by silverglade; 11-05-2009 at 07:50 PM..
silverglade is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 11-05-2009, 08:09 PM Re: my login script page is not working on remote computers
Webmaster Talker

Posts: 611
Trades: 0
i got both the login to work and the paypal button to work by accepting ALL cookies in browser setting. but i cant possibly require all my visitors to do that to buy off the site. what should i do please?
silverglade is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to my login script page is not working on remote computers
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.13293 seconds with 12 queries