Adding class to php scripts?

So I’ve read a few tutorials on PHP 5 classes and seems like the approach I should take, however the vast majority of i.e. 100% of the tutorials pretty much give non-useful examples for anyone building an actual website. No offense intended to anyone.

Currently my first script is sort of evolving into this construct


<?php session_start(); $valu = $_GET['opt']; switch($valu) { case 'register': register_an_account(); break; ...... Function register_an_account() { include('global_var.php'); include($globalvar['default_template'].'header.php'); include($globalvar['default_template'].'temp_register.php'); include($globalvar['default_template'].'footer.php'); } [/php] Via < a > links I call the member.php passing the required function id I want to perform, in the above case kicking off a registration form. Okay my question is can I do the same via a declared class? Where I would have member.php declared as class member with the fields etc defined as attributes and the functions as events (not sure if that makes any sense in a php world). So within the Class event Register I would call my form, have it filled out and then reiterate the class for creating the member account. Hope that makes some sort of sense :)
Sponsor our Newsletter | Privacy Policy | Terms of Service