Jump to content

If certain IP -- show link?


ps2cho

Recommended Posts

Hey guys,

Is there a script that would show a certain link/text if the IP address matches one in the script?
I simply want to have a post news button for me only...and i dont want to keep havign to type in the login in the address bar.

Gotta keep the site clean :)

Any way to do this?

Thanks!
Link to comment
Share on other sites

[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 :/
Link to comment
Share on other sites

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]
Link to comment
Share on other sites

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.
Link to comment
Share on other sites

[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!
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

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