Using PHP to invoke the flash_php base on different servers

Source: Internet
Author: User
Recently, the school anniversary, made a flash animation site, but the volume is relatively large. If uploaded to the school server, from the Public Information network access is relatively slow, and put the education network from the campus network access on the relatively not smooth, fortunately, we have PHP, solve this problem!
The code is as follows:
<title> Celebration Anniversary </title>
<body bgcolor= "#f2d560" topmargin=0 leftmargin=0>
<?php
$remote _addr=getenv ("remote_addr");
$testip = "202.117.6";
$realip =substr ($remote _addr,0,9);
if ($testip = = $realip) {
$url = "http://202.117.68.12/~flyhawk/cau.swf";
$word = "Grow Up Campus network";
}else{
$url = "http://webnow.oso.com.cn/cau.swf";
$word = "Public Information network";
}
?>
<script language= "JavaScript" >
function Info ()
{

if (!confirm) ("Welcome to Chang ' An celebration Theme network" + "\ n \ \ \ \ \ \ \ \ ip:&lt echo $remote _addr? >\n\n you come from the echo $word? >\n\n Please wait ... \n\ n is booting the Web page to provide the fastest network transport "+" \n\n\n please click OK to go to this page \ n "+" \ n "Cancel will leave this site \ n" + "\n\n\n" I Love Chang "))

History.go ( -1); return ""

}

Document.writeln (Info ()) </script>

</SCRIPT>

<embed src= ". echo $url?> "Quality=high pluginspage=" http://www.macromedia.com/shockwave/download/index.cgi? P1_prod_version=shockwaveflash "type=" Application/x-shockwave-flash "width=" 100% "height=" 98% ">
</embed>

</body>
Simple tip:
$remote _addr=getenv ("remote_addr"); is to obtain the IP of the client.
$realip =substr ($remote _addr,0,9); Get the first 9 bytes of IP, because our school's IP address is 202.117.6*.*, so, by judging $realip and $testip values of different to determine the value of $url, That is, the file location of Flash.
For the demo of this procedure, see: http://www.caunet.com

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.