| View previous topic :: View next topic |
| Author |
Message |
weisswolfen
Joined: 04 Feb 2007 Posts: 1
|
Posted: Sun Feb 04, 2007 12:02 pm Post subject: PHP random script question |
|
|
New and happy to be part of this forum to learn and have some php fun.
I'm new at PHP and I have a script to get images placed at random everytime the header is refreshed. My problem is that I don't know how to insert the PHP script in a HTML DIV. Is working as a PHP stand alone and rotating well, but when I get the script in the HTML page doesn't work.
I don't want to change the page from HTML to PHP since I have AJAX and Fjax in the same page and I don't know if they would work in PHP. This is the script:
<div class="lowtitle">
<?php
$images = 5;
$path = "shotrotation/";
$random = rand(1,$images);
echo "<img src=$path"."$random".".gif"." border=\'0\'>"
?>
</div>
Any suggestions how to make it work?
Thanks |
|
| Back to top |
|
 |
reins

Joined: 30 Oct 2006 Posts: 23
|
Posted: Sun Feb 04, 2007 12:34 pm Post subject: |
|
|
| php only works if the page extension is .php ... |
|
| Back to top |
|
 |
|