How would you use 2 submit buttons? Like each one sends different paramaters/variables. Im trying to make a Picture viewer where when you click next the next pic shows up and previous goes to the previous one, something like that. Cause as far as I know you cant assign a value to submit types?
rage2021 wrote:Cause as far as I know you cant assign a value to submit types?
Cause as far as I know you cant assign a value to submit types?
sure you can:
<form action="" method="POST"> <input type="submit" name="submit" value="prev"> <input type="submit" name="submit" value="next"> </form>
if $POST['submit'] == 'prev' show the last picture if $POST['submit'] == 'next' show the next picture
Or, you could also do this:
<input type"button" value="Previous" onClick="location='page.php?prev=1" /> <input type"button" value="Next" onClick="location='page.php?next=1" />
thanks for the advice! 🙂