I just came across modifying an existing site that was developed before by someone else.
While making changes in PHP files, I noticed that the variables that are not declared (not even in the included file) are used successfully.
I cannot understand how this is done. Is it using the PHP's magic methods (_get and _set)?
An example scenario is this.
<?php
if($name != ""){
//do process
}
?>
<form method="POST">
<input type="hidden" name="name" value="" />
</form>
In normal scenario above code would throw an error for undefined variable. I can also see that all variables like above is mainly for hidden inputs or $_GET variables.
But above code works perfectly fine in the site I am developing even though $name variable hasn't been assigned to $_POST['name'] or $_REQUEST...
Can anyone please suggest a way to do such a thing in PHP or am I missing something here.