Hi All,
i'm new to php, i have small problem to construct my website.
i have a code of "page1.php" which is a form to be filled and submited or have a preview before submit or ... , so i have 4 buttons when i click any one of them will post to "page2.php" and execute only the corresponding code of the last action:
"page1.php"
<?php
<form action="page2.php" method="post">
...
.. code of the form.
.
<input type="submit" name="submit_button" value="submit">
<input type="submit" name="save_button" value="save & continue">
<input type="submit" name="preview_button" value="preview">
<input type="submit" name="clear_button" value="clear">
</form>
?>
"page2.php"
<?php
if(submit_button hit)
{ ... code for submit button...}
if(save_button hit)
{ .... code for save button ...}
if(preview_button hit)
{ ... code for the preview button...}
...
..
.
?>
My question: is there any php function to specify the 'submit_button hit' or 'save_button hit' or any clicked button action? or there any other idea to do the same task?
Note: i did my code like that because i "in my knowledge" can not have a multi form action
<form action="$var" method="post">
Thanx in advance.
Fat.