PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
Moderator: General Moderators
nickman013
Forum Regular
Posts: 764 Joined: Sun Aug 14, 2005 12:02 am
Location: Long Island, New York
Post
by nickman013 » Sun Oct 22, 2006 1:07 pm
Hello,
I am trying to echo somthing so if the persons IP is in a array of IPs. I cannot get it to work. I am pretty sure I did it correctly.
My code now:
Code: Select all
<?
$ip = @$REMOTE_ADDR;
$authip = array('IP, IP, IP, IP');
if ($ip == $authip) { echo " bgcolor=orange" };
?>
IP, IP are peoples ip addresses
Zoxive
Forum Regular
Posts: 974 Joined: Fri Apr 01, 2005 4:37 pm
Location: Bay City, Michigan
Post
by Zoxive » Sun Oct 22, 2006 1:11 pm
brendandonhue
Forum Commoner
Posts: 71 Joined: Mon Sep 25, 2006 3:21 pm
Post
by brendandonhue » Sun Oct 22, 2006 1:32 pm
Your array there only has 1 element in it, I think you're also looking to put each IP as a separate value in the array.
nickman013
Forum Regular
Posts: 764 Joined: Sun Aug 14, 2005 12:02 am
Location: Long Island, New York
Post
by nickman013 » Sun Oct 22, 2006 1:33 pm
Code: Select all
echo "<td align=left width=100 valign=top";
if (in_array($row4['ip'], $authip)) {
echo " bgcolor=orange"
};
I get
Parse error: parse error, unexpected '}', expecting ',' or ';' in /home/muot/public_html/muotreport2.php on line 503
line 503 is };
Thanks for helping.
nickman013
Forum Regular
Posts: 764 Joined: Sun Aug 14, 2005 12:02 am
Location: Long Island, New York
Post
by nickman013 » Sun Oct 22, 2006 1:37 pm
Thanks alot.