Web Weather > Weather Website PHP/AJAX scripting

Advisory script help

(1/1)

dre:
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

TNETWeather:
PHP scripts must be in web pages that end in .PHP

So your index.html would need to be  index.php

dre:
Thanks Kevin

I think I'm starting to understand this.
Doug

TNETWeather:
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.

Navigation

[0] Message Index

Go to full version