|
|
|||||||||
|
|||||||||
|
|||||||||
| |
|||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
|
|
Free Web 2.0 Code Generator! Generate data entry and reporting .NET Web apps in minutes. Quickly create visually stunning, feature-rich apps that are easy to customize and ready to deploy. Download Now!
|
|
#1
|
|||
|
|||
|
Form
The submit button in the form I created is named "submit" and has a value of "Add". When the PHP script is executed, it checks if $HTTP_POST_VARS["submit] == "Add". The script runs and returns expected results if the form is submitted properly (click on the submit button). A problem arises when I click ENTER, say in a text box, since the variable $HTTP_POST_VARS["submit] is not sent to the PHP script. Is there a way to solve this?
|
|
#2
|
|||
|
|||
|
What about using one of the variable names passed by the form?
|
|
#3
|
|||
|
|||
|
their is a better way!
in your form tag add this method="<?php echo $PHP_SELF; ?>?what=add" then when the page gets processed if($what == "add") { //process info here! } else { //display form! } their you go, if you have multiple values for $what then you can use the switch statment, but that doesnt apply here. thats probally the best way |
|
#4
|
|||
|
|||
|
Ok... Thanks.
|
|
#5
|
|||
|
|||
|
no probs, the reason why i suggest that method, is because it always works no matter what you press
|
![]() |
| Viewing: Dev Articles Community Forums > Programming > General Programming Help > Form |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|