Not for 'how-to' coding questions but PHP theory instead, this forum is here for those of us who wish to learn about design aspects of programming with PHP.
Well , i want to know what form is submited ( a page can contain many forms ) , so i generate this .
I'm doing a little change to the code to make it clearer
It's still a mess , don't try to apply it to your real application , because it can mess your HTML Id name Name ( i'm stupid ) , but you can test with it
I have written 4 rules so far , you can view it in "rule.txt" , the rule name is clear to understand
To enable validation for a form
<form ..... validation="mode">
where mode can be server,client,and both
Try it , and tell me what you think ..... about this mess
quocbao wrote:Try it , and tell me what you think ..... about this mess
Well I tried to try it. First, it would be great if you used gzip or zip rather than rar. Then use "<?php" in your files rather than "<?". And don't use pass by reference in smartValidator.php. And put "if (isset(...)) {" checks around your foreach loops.
Even after fixing all of that it didn't print any error messages. Maybe version 2?
I want to pass by reference , because i want this function only return true / false .
If true then everything is ok , but if false then the form is not submited or data is not valid .
And put "if (isset(...)) {" checks around your foreach loops.
Can you show me this part ?
Even after fixing all of that it didn't print any error messages. Maybe version 2?
As you see , i use reference when a function return more than one value ( this function return new form content and server validation value ) . And i don't have any solution yet but pass by reference.
As you see , i use reference when a function return more than one value ( this function return new form content and server validation value ) . And i don't have any solution yet but pass by reference.
If you want to pass by reference then specify it in the function, not when you pass the variable to the function. The line above gives a Notice/Warning
quocbao wrote:
Sorry about that, i used "<?" when i first programmed PHP , and it's become a habit .
But why "<?php" ? "<?" is shorter
I can't run the code with default PHP 5.1.2 settings, and had to change them all to '<?php'