Jump to content

[SOLVED] $_POST variables in a class?


mbowling

Recommended Posts

Probably to make the class re-usable.  If you hardcode $_POST into your class, then your class will only work with post forms with those particular variable names.  But if you process the data in index.php then pass it to your class, the class is much more flexible.

 

If you have no intention of ever re-using your class elsewhere, then yes you can use $_POST inside it and forget the whole thing :)  You'll probably regret it later, but it's all a learning experience..

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.