Wednesday, 21 August 2013

How to use javascript/other method in order to print the date in a format, when requesting an image generated by a php script?

How to use javascript/other method in order to print the date in a format,
when requesting an image generated by a php script?

I am creating a site using bootstrap to give weather updates at the beach.
MY SITE
The following php script requests the correct image.
http://www.ntslf.org/files/php/pltdata_tgi.php?port=Liverpool&span=4&from=20130821
the last set of numbers is the date backwards.
Basically I want this image to update in the page and be the correct date.
I tried using javascript but i couldn't get it to work
var var d = new Date();
var n = d.getDate();
here is the source code for the website:
<div class="col-lg-6">
<h3>Tides</h3>
<p>Tides over the next 2 days</p>
<img
src="http://www.ntslf.org/files/php/pltdata_tgi.php?port=Liverpool&span=4&from=20130821"
class="img-responsive" alt="Responsive image">
</a>
</div>

No comments:

Post a Comment