|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Php form Validation
Sir/Ma'am,
I'm new in php, my problem is how can i validate the form using function in one page? Thanks in advance |
|
#2
|
||||
|
||||
|
RE: Php form Validation
Not entirely sure of what you mean, more specifics would help but, in general it is possible to check the forms using if statements however this can only be done (so far as I am aware) once the form has been submitted via the POST action ( or the other html action for less data whose name escapes me).
So assuming you are using post you could use: if(isset($_POST['***THE_BUTTON_USED_TO_POST***'])){ //do stuff } you can get at specific bits of the form by using their name, eg textarea called POX accessed by: $_POST['POX'] If you're wondering $_POST is big badass global variable that is rather useful, look it up in the manual, they tend to explain things better than me anyhow. Hope that helps and that I've not gone off at some mad tangent because then I'd feel a bit silly and suddenly very glad that its unlikely I'll ever meet any of you bunch. |
|
#3
|
||||
|
||||
|
RE: Php form Validation
You can use regular expressions in PHP or javascript if I understand you correctly.
this line of code will show you everything your are passing if you put it on the target page (action='target') there are lots of ways to do form validation but I reccomend either using regular expressions or validating with some routines on the target page. B |
![]() |
| Viewing: Codewalkers Forums > PHP Related > PHP Coding > Php form Validation |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|