Author Topic: Advisory script help  (Read 2443 times)

0 Members and 1 Guest are viewing this topic.

Offline dre

  • Member
  • *
  • Posts: 29
    • Weather by the Bay
Advisory script help
« on: January 05, 2008, 05:58:01 PM »
Folks,

I'm having lots of trouble understanding how to use PHP scripts in my HTML.  Thanks to your help, I was able to get the fire danger script to work.  Now I'm trying to get Carterlake's NOAA advisory script to work.  I've placed his HP script in my index.html file and what I open the page I get a display of the PHP not the advisory.  What am I doing wrong?
Thanks in advance
Doug

Offline TNETWeather

  • Kevin Reed (KrelvinAZ)
  • Senior Contributor
  • ****
  • Posts: 193
  • Davis Vantage Pro2+ with full FARS
Re: Advisory script help
« Reply #1 on: January 05, 2008, 06:19:50 PM »
PHP scripts must be in web pages that end in .PHP

So your index.html would need to be  index.php
All you need is Time, Aptitude and Desire ... and you can build just about anything...

Offline dre

  • Member
  • *
  • Posts: 29
    • Weather by the Bay
Re: Advisory script help
« Reply #2 on: January 05, 2008, 06:30:01 PM »
Thanks Kevin

I think I'm starting to understand this.
Doug

Offline TNETWeather

  • Kevin Reed (KrelvinAZ)
  • Senior Contributor
  • ****
  • Posts: 193
  • Davis Vantage Pro2+ with full FARS
Re: Advisory script help
« Reply #3 on: January 05, 2008, 09:32:49 PM »
Basically all your web pages could end in .php even though they don't have any PHP in them at all.  That extension tells the web server that the script "could" have PHP and to look for it.

Only when in the page the web server comes across a PHP Start like

<?php

will it start to parse what is in the script as expecting to be PHP code and it stops when it finds a PHP End code like:

?>

Note that many web servers will recognize the PHP Start with the short cut of

<?

But it is best to always use <?php as it is more portable to websites that don't use the shortcuts.
All you need is Time, Aptitude and Desire ... and you can build just about anything...