I have a form that references a script file that instantiates an object of a class. Then uses public methods of the class to do validation.
example
$fv = new FormValidator(); //New FormValidator Object
// Name is coming from a FORM
$fv->isEmpty("name", "Please enter a name"); // Call isempty method
I copied this code from a tutorial.
I see that $fv-> works by passing the "name" to the Class, but my problem arises here- I have register globals off
Running the code normal fails-
But if I add this:
$name = $_POST['name']; before I call the method it works.
Why does this work? It confuses me because I would think that I would have to change the call to the method to
$fv->isEmpty("$name" ......etc) but I do not.
Thanks for your help.