next/previous button help

Discussion in 'PHP' started by izlik, Mar 1, 2009.

  1. #1
    Hello. im unsure if it's here i should ask but i belive this can be solved in php. i have this page where i have some random flash files named from 1 to 10(and adding more all the time). i was wondering how i can make the previous and next buttons work? so if i watch the flash 1.swf next button should take me to 2.swf etc.



    <?
    $files = glob('*.jpg');
    rsort($files);
    ?>
    
    </form>
    	<table border="1" width="100%">
    		<tr>
    			<td><p>
    			<object classid="clsid:D27CDB6E-AE6D-11CF-96B8-444553540000" id="obj1" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0" border="0" width="1192" height="534">
    				<param name="movie" value="/1.swf">
    				<param name="quality" value="High">
    				<embed src="/1.swf" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" name="obj1" width="1192" height="534"></object>
    			</p>
    			<p align="center">
    	<input type="submit" name="btn_previous" value="&lt;&lt; Previous" id="btn_previous" style="width:100px;" />
    	<input type="submit" name="btn_next" value="Next >>" id="btn_next" style="width:100px;" />
    			</td>
    		</tr>
    	</table>
    HTML:

     
    izlik, Mar 1, 2009 IP
  2. EricBruggema

    EricBruggema Well-Known Member

    Messages:
    1,740
    Likes Received:
    28
    Best Answers:
    13
    Trophy Points:
    175
    #2
    you need to make a real form (starting <form> and closing </form>) then remember the current ID in a hidden field (<input type="hidden" name="current" value="currentnumber">) and then check if the previous or next button is clicked

    $_POST
    $_SERVER['REQUEST_METHOD']

    Have fun!
     
    EricBruggema, Mar 3, 2009 IP