[PHP] Re: 1 Form, 2 Submit-Buttons

2002-07-12 Thread Johan Holst Nielsen

 Hello! I want to make a form (a wizard) which has 2 Submit-Buttons (Back
  Next). The buttons should be images. How can I make php see, which
 button has been pressed?


?php
if(isset($_POST[submit_back])) {
//go back
}
else {
//go forward
}
?
form action=?=$_SERVER[PHP_SELF]? method=post
input type=submit name=submit_back value=Back
input type=submit name=submit_next value=Next
/form


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP] Re: 1 Form, 2 Submit-Buttons

2002-07-12 Thread Johan Holst Nielsen



Johan Holst Nielsen wrote:
 Hello! I want to make a form (a wizard) which has 2 Submit-Buttons (Back
  Next). The buttons should be images. How can I make php see, which
 button has been pressed?
 
 
 
 ?php
 if(isset($_POST[submit_back])) {
 //go back
 }
 else {
 //go forward
 }
 ?
 form action=?=$_SERVER[PHP_SELF]? method=post
 input type=submit name=submit_back value=Back
 input type=submit name=submit_next value=Next
 /form
 

Oooh sorry... offcouse
input type=image src=image.png name=submit_back...



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




RE: [PHP] Re: 1 Form, 2 Submit-Buttons

2002-07-12 Thread John Holmes

 give a name to the buttons ie: Next
 input name=Next type=image id=Next src=whatever
 
 and check in php
 ?
   if(isset($Next.x)  isset($Next.y)){
   // do somehting here
 }
 ?

Actually, when an image is clicked on to submit the form, two variables
are created. If the image is named 'Next' like the example above, then
you'll have $Next_x and $Next_y (or the equiv. in the _GET or _POST
array). The variables will hold the x/y value of where the image was
clicked. You can just check to see if one of those variables is set.

---John Holmes...


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP] Re: 1 Form, 2 Submit-Buttons

2002-07-11 Thread Leonid Vaner

give a name to the buttons ie: Next
input name=Next type=image id=Next src=whatever

and check in php
?
  if(isset($Next.x)  isset($Next.y)){
  // do somehting here
}
?

do the same with Previous
Martin Thoma [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 Hello! I want to make a form (a wizard) which has 2 Submit-Buttons (Back
  Next). The buttons should be images. How can I make php see, which
 button has been pressed?

 Martin





-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php