Jump to content

aog

New Members
  • Posts

    5
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

aog's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Ok. I found one problem. Some how the last number of the ip 192.168.x.x was missing in the DB. (Sorry..) Once I fixed that, I discovered that else { echo "NOT VALID!"; } does not work either on local or remote computer. So, if IP is in table2, it works as intended, but not if the IP is missing in the table. What am I missing here?
  2. Works both ways, but I guess you know what you're talking about. Fixed it, but it won't fix my main problem.
  3. Yes, you are right. How ever, it didn't change my problem.
  4. Hello all. I am working and googling my keyboard out the window here with a script. I'm not really skilled in PHP or mySQL, but I try. My problem here is in the script you see below. If I enter the page from computer with IP:127.0.0.1 (witch is the lockalhost), the script works as I want. But if I enter the page from computer with ip 192.168.x.x (a computer on the LAN), the script does not work. I do get the echo ("You are $remote");, but the rest of the script wont work regardless of the 192.168.x.x can be found in $result = mysql_query("SELECT * FROM $table2 WHERE client_ip='$remote'"); or not. What am I doing wrong? EDIT: Fixed the = to == <?php include ("login.php"); include ("db_info.php"); $remote = $_SERVER['REMOTE_ADDR']; echo ("You are $remote"); mysql_select_db($db, $con); $result = mysql_query("SELECT * FROM $table2 WHERE client_ip='$remote'"); while($row = mysql_fetch_array($result)) { if ($row['client_ip'] == $remote) { $ip = $row['client_ip']; $name = $row['client_name']; echo $ip . " " . $name; echo "<br/>"; } else { echo "NOT VALID!"; } } mysql_close($con); ?>
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.