I was wondering how to allow IP addresses to view my page. I want to make a list of IPs that are allowed, and all others will be blocked. I also would like to call on that PHP file from Flash, and if the IP is allowed, the Flash will go to a specified frame number. Does anyone have any idea on how to do this? EDIT: Here is my current code: <? $allow[0]="0.0.0.0"; if (in_array($_SERVER['REMOTE_ADDR'],$allow)) { echo "Welcome" ; } else echo "You are not authorized to view this page." ?> PHP:
Should work just fine. <?php $allowed = array('127.0.0.1'); if ( !in_array($_SERVER['REMOTE_ADDR'], $allowed) ) die('You\'re not allowed here.'); /* otherwise put the rest of your code here */ // _stuff(); more_stuff($var); PHP: Makes a code for easier reading, after the die statement just put any code you want if they're valid. Could you use a AJAX request via Flash (not familar with flash personally) to get the page, although I fear this could be easily spoofed.
I don't know. I just want to call the PHP file from Flash and if the user is allowed, the Flash goes to frame 2. If not, frame 3.