Jump to content

random div on refresh


mraza

Recommended Posts

hi i have 2 divs in my page:

 

<div id="one">
<a href="1.html"><img src="img.gif"></a>
<p>First paragraph</p>
</div>

<div id="two">
<a href="2.html"><img src="img2.gif"></a>
<p>Second paragrapht</p>
</div>

Now what i want is whenever a page refresh or reload it will show the other image or paragraph in that div. like if i refresh it becomes like this:

<div id="one">
<a href="3.html"><img src="img3.gif"></a>
<p>3rd paragraph</p>
</div>

<div id="two">
<a href="4.html"><img src="img4.gif"></a>
<p>4th paragrapht</p>
</div>

please any help how can i accomplish that thanks.

Link to comment
https://forums.phpfreaks.com/topic/182916-random-div-on-refresh/
Share on other sites

like in your example you say after #1 and #2 div there should show next #3 and #4 div.

 

when you will call randomly then it will not be shown serial wise like you said.

 

random function will show the result randomly which ever number may come.

 

http://php.net/manual/en/function.rand.php

 

vineet

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.