chinna,
1) instead of using a meta refresh, you can use a javascript to submit the form after 10 seconds
<form name="myForm">
<!-- your test form data here -->
</form>
<script language="JavaScript"><!--
setTimeout('document.myForm.submit()',10000);
//--></script>
You can also look at the thread [thread=10338069]Here[/thread].
It displays a Random Image from an array (taken in from an INI file) that does not repeat.
You can easily modify it to handle your questions.
<?php
// Origionally Compliments of KevinMG on phpbuilder.com/board/ at
//http://www.phpbuilder.com/board/showthread.php?t=10329337
// Modified by big.nerd to work with images :)
function showImage($numpics = 2) {
$ini_file = 'images.ini';
# read the config file into an array or die trying
$images = @parse_ini_file($ini_file,true);
if (! $images) {
die('cannot read ini file');
}
$usedpics = array();
for ($i = 0; $i < $numpics; $i++) {
$img = array_rand($images);
while(in_array($img,$usedpics)) {
$img = array_rand($images);
}
$usedpics[$i] = $img;
# get the selected image's css id if one exists
$id = $images[$img]['id'] ?
sprintf( ' id="%s" ', $images[$img]['id'] ) :
'';
# get selected image's dimensions
$size = @getimagesize( $images[$img]['src'] );
# if an url was specified, output the opening A HREF tag
if ( $images[$img]['url'] ) {
printf(
'<a href="%s" title="%s" target="blank">',
$images[$img]['url'],
$images[$img]['title']
);
}
# output the IMG tag
printf(
'<img src="%s" alt="%s" %s %s%s/ border="0">',
$images[$img]['src'],
$images[$img]['alt'],
$size[3],
$id,
$class
);
# if an url was specified, output the closing A HREF tag
if ( $images[$img]['url'] ) {
echo('</a>');
}
}
}
showImage(5); // Show 5 Pictures
?>
This script will select a number of images (passed by a parameter) or assume 2 images if no parameter displayed.
They will not repeat (unless the page is refreshed).
Since you will be working across a number of pages, I would recommend using sessions to store $usedpics (or the used questions in your case) across the board so they won't repeat on the next page.
Good Luck