View Single Post
  #1 (permalink)  
Old 2008-03-15, 05:07 AM
mattisdada mattisdada is offline
Junior Member
 
Join Date: Mar 2008
Posts: 6
mattisdada is on a distinguished road
Default Im attempting at making my own comic engine

Im attempting at making my own comic engine...

This is what ive made so far. It half works....

Baiscly, the question is, how do i stop it excecuting the button scripts everytime the page loads(Thats my problem).(So when i have both Prev and Next on the page nothing happens, but when i have only 1, it excecutes fine(except if i refreash bthe page, it still does next/prev :P)

Code:
<?php
session_start();
session_register("comic");
if ($_SESSION['comic'] < 1){$_SESSION['comic'] = 1;}
echo $_SESSION['comic'];
?>
<body>
<img src="comic/<?=$_SESSION['comic']?>.jpg">

<form name="form1" method="post" action="<? $_SESSION['comic']++?>">
  <input type="submit" name="Next" id="Next" value="Next">
</form>
<form name="form2" method="post" action="<? $_SESSION['comic']--?>">
  <input type="submit" name="Prev" id="Prev" value="Prev">
</form>
</body>
Im really new to this sorry guys. This is the second script ive ever made.... (Although my first one is awesome, its a benchmarker for Server's and Browsers... My script found that Opera(9.5) is the fastest, then IE7 is second fastest, and Firefox(3 and 2) was slowest.)


Oh and making it a GET_ variable would be cool to if you guys could show me how to convert it .(You know, so if someone visits www.blahblah.com/blah.php?=5, it would be the 5th comic and stuff. Thanks! )

Last edited by mattisdada; 2008-03-15 at 05:24 AM.
Reply With Quote
Sponsored Links