Webmaster Forums - Webmaster forum for HTML, PHP, ASP, CSS and more

Go Back   Webmaster Forums - Webmaster forum for HTML, PHP, ASP, CSS and more > Web Programming > PHP Development
User Name
Password

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old 08-10-2006, 03:47 PM   #1 (permalink)
iSellJerseyShore
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
__________________
webmaster of www.iSellJerseyShore.com & www.UnWantedReptiles.com
iSellJerseyShore is offline   Reply With Quote
Sponsored Links
Old 08-10-2006, 08:35 PM   #2 (permalink)
O~Snapple
Moderator Of The Year
 
O~Snapple's Avatar
 
Join Date: Jul 2006
Location: Cali Breeze
Posts: 716
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
__________________
The Real Truth
Epademik Emcee Esq. New Album The 3rd Finger is in Stores Now!
Snap Marketing Management and Consulting
O~Snapple is offline   Reply With Quote
Old 08-10-2006, 08:40 PM   #3 (permalink)
iSellJerseyShore
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
__________________
webmaster of www.iSellJerseyShore.com & www.UnWantedReptiles.com
iSellJerseyShore is offline   Reply With Quote
Old 10-26-2006, 05:39 PM   #4 (permalink)
limerex9981
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, 06:33 PM   #5 (permalink)
Aragami
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, 01:52 PM   #6 (permalink)
Viola86
Junior Member
 
Join Date: Oct 2006
Posts: 1
Post Видео, Приколы, Халява.

автор: | - Бесплатное порно - |
Внимание только сегодня я добрый, много интересного и прикольного выкладываю
на сайт посвященный развлеченияь
Качайте на здоровье!
Viola86 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

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

Points Per Thread View: 1.00
Points Per Thread: 11.00
Points Per Reply: 5.00



» Sponsors

» Links

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

» 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 03:33 PM.



LinkBacks Enabled by vBSEO 3.0.0 RC8
Webmaster Forums