Jump to content

If certain IP -- show link?


ps2cho

Recommended Posts

[quote author=artacus link=topic=117682.msg480302#msg480302 date=1165468037]
missing {}'s
and you need your IP address like 63.64.65.66
[/quote]

Lol i realize how a IP looks...i didnt want my IP to be given out publically.

But where do the {}'s go ?

EDIT: wait nevermind im dumb :/ even after taking AP Computer Science....

Asked friend to test for me and he said that he can see the word link..
hmm

EDIT2: Nvm he thought i meant in the AIM box :/
Okay this is frustrating me...

[code]<?php {
$ip = $_SERVER['REMOTE_ADDR'];
if ($ip == "68.xx.xx.xx")
echo "<html><b><a href="http://xxx.no-ip.com/NewPage/news">Main News</a><br><a href="http://xxx.no-ip.com/NewPage/pages/journal/news">Journal News</a><br></html>";
else
null;
}
?>[/code]

Why does this keep erroring out?

[quote]Parse error: parse error, unexpected T_STRING, expecting ',' or ';' in C:\wamp\www\NewPage\leftside.php on line 122[/quote]
Just cleaned up your code:

[code]
<?php
$ip = $_SERVER['REMOTE_ADDR'];
if ($ip == "68.xx.xx.xx")
echo "<html><b><a href=\"http://xxx.no-ip.com/NewPage/news\">Main News</a><br><a href=\"http://xxx.no-ip.com/NewPage/pages/journal/news\">Journal News</a><br></html>";
else
null;

?>
[/code]

Tested the above with my IP address, and it worked fine.
[quote author=bljepp69 link=topic=117682.msg480325#msg480325 date=1165472148]
Just cleaned up your code:

[code]
<?php
$ip = $_SERVER['REMOTE_ADDR'];
if ($ip == "68.xx.xx.xx")
echo "<html><b><a href=\"http://xxx.no-ip.com/NewPage/news\">Main News</a><br><a href=\"http://xxx.no-ip.com/NewPage/pages/journal/news\">Journal News</a><br></html>";
else
null;

?>
[/code]

Tested the above with my IP address, and it worked fine.
[/quote]

Yep got it to work now. Thanks guys!

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.