GIDForums  

Go Back   GIDForums > Computer Programming Forums > MySQL / PHP Forum
User Name
Password
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

 
 
Thread Tools Search this Thread Rate Thread
  #1  
Old 18-Sep-2005, 15:49
I, Brian I, Brian is offline
New Member
 
Join Date: Sep 2005
Location: Stirling
Posts: 6
I, Brian is on a distinguished road

Order randomisation of content with PHP


Sorry to ask a simple question, but I'm looking to randomise a display of content, which are called up with basic PHP include files.

So if there are 5 images, I'm calling them up as:

PHP Code:

<!-- site content above --> 
<?PHP include("/home/user/public_html/section1.php"); ?> 
<?PHP include("/home/user/public_html/section2.php"); ?> 
<?PHP include("/home/user/public_html/section3.php"); ?> 
<?PHP include("/home/user/public_html/section4.php"); ?> 
<?PHP include("/home/user/public_html/section5.php"); ?>
<!-- footer below --> 



How would I randomise with a script within the body itself?

Many thanks for any replies.
Last edited by admin : 18-Sep-2005 at 17:36. Reason: Please insert your PHP code between [php] & [/php] tags
  #2  
Old 18-Sep-2005, 17:46
admin's Avatar
admin admin is offline
Administrator
 
Join Date: Sep 2002
Posts: 858
admin will become famous soon enough
Hello I, Brian,

You didn't explain yourself very well so I will simply throw out some suggestions.

You can use mt_rand( int min, int max ); to get some random id very easily.

Then there are the ARRAY functions themselves, out of which you may want to read up on:
array_rand( array input [, int num_req] ).
__________________
Custom BB codes you can use here:
[HTML] | [C++] | [CSS] | [JAVA] | [PY] | [VB]
 
 

Recent GIDBlogInstall Adobe Flash - Without Administrator Rights by LocalTech

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
PHP script to show last referrer url and top referrer to your site jrobbio MySQL / PHP Forum 6 22-May-2006 01:06
RESELLER WEB HOSTING - $9.99/MONTH For 4GB HD & 30GB BW! CPanel, PHP, MySQL & MORE! IncognitoNet Web Hosting Advertisements & Offers 0 30-Jan-2005 21:46
RESELLER WEB HOSTING - $9.99/MONTH For 4GB HD & 30GB BW! CPanel, PHP, MySQL & MORE! IncognitoNet Web Hosting Advertisements & Offers 0 11-Nov-2004 19:51
Two virtual hosts, cgi script behaves differently on each blimbo Apache Web Server Forum 0 04-Aug-2004 09:35
php & txt files dopee MySQL / PHP Forum 5 06-May-2004 03:05

Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The

All times are GMT -6. The time now is 21:31.


vBulletin, Copyright © 2000 - 2010, Jelsoft Enterprises Ltd.