How-To add PHP script to site? - Webmaster Forums - Webmaster forum for HTML, PHP, ASP, CSS and more
Webmaster Forums - Webmaster forum for HTML, PHP, ASP, CSS and more
Go Back   Webmaster Forums - Webmaster forum for HTML, PHP, ASP, CSS and more > Webmaster Tech > Programming > PHP Development

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old 08-10-2006, 02:47 PM   #1 (permalink)
Junior Member
 
Join Date: Aug 2006
Posts: 17
Question How-To add PHP script to site?

YOUR POST HAS BEEN EDITED FOR PHP CODE USE
PLEASE USE PROPER CODES WHEN POSTING

I am interested in adding this PHP script to my site. I have followed the instructions provided on the following link.

http://www.ofhills.com/blog/index.ph...or_alert_level

Where do I actually insert the PHP script?

PHP Code:
<?

$myCheckInt 
= (60*60*4); //time between checking DHS = 4 hours

$filename "alert.dat"//put this empty file in directory, chmod 777

$myURL "http://www.dhs.gov/dhspublic/display?theme=29&content=320";

$file_last_modified filemtime($filename);
$currentTime time();

$f_pointer fopen($filename"r");
$f_read fread($f_pointerfilesize($filename));
fclose($f_pointer);

if ((
$currentTime $file_last_modified) > $myCheckInt || $f_read =="")
{
     if (!(
$siteContent file($myURL)))
          die (
"failed to access info!");
     foreach(
$siteContent as $line
     {
          if (
preg_match("/img name="dhsadvisory"/"$line))
               
$theLine $line;
     }
     
$f_pointer fopen($filename"w");
     
fwrite($f_pointer$theLine);
     
fclose($f_pointer);

} else {

$theLine $f_read;}

if (
preg_match("/alt="Red Advisory"/"$theLine))
{
     echo 
"Red Advisory: Severe risk of terrorist attacks.<br><br>";
     echo 
"<img height="40" width="125" border="0" src="dhs-advisory-severe.gif">";
     echo 
"<body bgcolor="#CC0000">";
}

if (
preg_match("/alt="Orange Advisory"/"$theLine))
{
     echo 
"Orange Advisory: High risk of terrorist attacks.<br><br>";
     echo 
"<img height="40" width="125" border="0" src="dhs-advisory-high.gif">";
     echo 
"<body bgcolor="#FF9900">";
}

if (
preg_match("/alt="Yellow Advisory"/"$theLine))
{
     echo 
"Yellow Advisory: Elevated condition; Significant risk of terrorist attacks.<br><br>";
     echo 
"<img height="40" width="125" border="0" src="dhs-advisory-elevated.gif">";
     echo 
"<body bgcolor="#FFFF00">";
}

if (
preg_match("/alt="Blue Advisory"/"$theLine))
{
     echo 
"Blue Advisory: Guarded condition; General risk of terrorist attack.<br><br>";
     echo 
"<img height="40" width="125" border="0" src="dhs-advisory-guarded.gif">";
     echo 
"<body bgcolor="#0033CC">";
}

if (
preg_match("/alt="Green Advisory"/"$theLine))
{
     echo 
"Blue Advisory: Low risk of terrorist attacks.<br><br>";
     echo 
"<img height="40" width="125" border="0" src="dhs-advisory-low.gif">";
     echo 
"<body bgcolor="#009900">";
}

?>
Thanks for your help!

-iSellJerseyShore
iSellJerseyShore is offline   Reply With Quote
Sponsored Links
Old 08-10-2006, 07:35 PM   #2 (permalink)
Member
 
O~Snapple's Avatar
 
Join Date: Jul 2006
Location: Cali Breeze
Posts: 718
Send a message via MSN to O~Snapple Send a message via Skype™ to O~Snapple
Default Re: How-To add PHP script to site?

Really depends on what your trying to acomplish Also Please use PHP tags when posting PHP
O~Snapple is offline   Reply With Quote
Old 08-10-2006, 07:40 PM   #3 (permalink)
Junior Member
 
Join Date: Aug 2006
Posts: 17
Default Re: How-To add PHP script to site?

I am trying to achieve the same result as the example on that site...


-iSellJerseyShore
iSellJerseyShore is offline   Reply With Quote
Old 10-26-2006, 04:39 PM   #4 (permalink)
Junior Member
 
Join Date: Oct 2006
Posts: 1
Post Travel & Turism

Travel Sudan at Travel & Tourism Search Engine - page 1 Travel Sudan
Travel Sudan
limerex9981 is offline   Reply With Quote
Old 10-26-2006, 05:33 PM   #5 (permalink)
Junior Member
 
Join Date: Oct 2006
Posts: 11
Default Re: How-To add PHP script to site?

There's a software called, PhpScripter, i've heard that this software if for php noobs and can add scripts on sites but i haven't tryed it.
Aragami is offline   Reply With Quote
Old 10-30-2006, 12:52 PM   #6 (permalink)
Junior Member
 
Join Date: Oct 2006
Posts: 1
Post Видео, Приколы, Халява.

автор: | - Бесплатное порно - |
Внимание только сегодня я добрый, много интересного и прикольного выкладываю
на сайт посвященный развлеченияь
Качайте на здоровье!
Viola86 is offline   Reply With Quote
Old 07-23-2011, 07:23 AM   #7 (permalink)
Regular User
 
Join Date: Jul 2011
Posts: 26
Default Re: How-To add PHP script to site?

excellent article, very useful 4 an web develepor, thk u
anoopWebtech is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



» Sponsors

» Links

» Affiliates
Web Hosting
Online Backup Reviews
Marketing Find
Merchant Select
SiteMap Builder
Host Compare

» Links

» Sports Network
Paintball Forum
Football Forum
Hockey Forum
Golf Forum
Boxing Forum
Lacrosse Forum
Baseball Forum
SnowBoarding Forum
Soccer Forum
MMA Forum


All times are GMT -4. The time now is 04:45 PM.


Powered by vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.2
Webmaster Forums
Web Hosting | Chicago Web Hosting | Web Hosting