Tutorialstream.com Forum Index
 FAQ   Search   Members   Usergroups   Register   Profile   Log in to check your private messages   Log in 

Log in
Username:    Password:      Log me on automatically each visit    
PHP random script question

 
Post new topic   Reply to topic    Tutorialstream.com Forum Index -> New Members
View previous topic :: View next topic  
Author Message
weisswolfen



Joined: 04 Feb 2007
Posts: 1

PostPosted: Sun Feb 04, 2007 12:02 pm    Post subject: PHP random script question Reply with quote

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
View user's profile Send private message
reins



Joined: 30 Oct 2006
Posts: 23

PostPosted: Sun Feb 04, 2007 12:34 pm    Post subject: Reply with quote

php only works if the page extension is .php ...
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Tutorialstream.com Forum Index -> New Members All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

phpBB SEO URLs V2 - Icons by Mark James

Powered by phpBB © 2001, 2005 phpBB Group