Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

In my nuke site I use something cal

Status
Not open for further replies.

reojeo

Programmer
Mar 11, 2002
2
In my nuke site I use something called "Admin by IP adress" and there is no documentation I can find to answer this question.

The first lines pasted into the admin.php are

if($REMOTE_ADDR !="999.999.999.999" && "999.999.999.999") {
include ("mainfile.php");
include ("header.php");

If I edit 999.999.999.999 to my ip, I get access. the question is can I add a second ip address different from the first? I have tried this and I cant seem to get it to work (sorry for I am very new as not understanding PHP much)

reo.......
 
Try changing the and to an or. If you leave it for the last minute, it only takes a minute.
-MetalEye the Procrastinoid
 
These lines should work
<?php
$adminips = array(&quot;xxx.xxx.xxx.1&quot;, &quot;xxx.xxx.xxx.2&quot;);
if (!in_array($REMOTE_ADDR, $adminips))
{
include (&quot;mainfile.php&quot;);
include (&quot;header.php&quot;);
....
Then just add more IPs by adding more elements to the array. //Daniel
 
Works.......thax danielhozac

reo.......
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top