Hi,

I have a question regarding Object Orientated Programming as it is baffling me.

Lets say I have a form called register. It is made up of Username, Password and Emai. Now when the user clicks submit the form will be handled by the class register but how does the methods know what the values are ?

<form name="register" action="register.php">
Username<input type="text" name="Username" />
Password<input type="text" name="Password" />
Email<input type="text" name="Email" />
</form>

Now I would have a method within a class like below:

public function checkLogin($Username, $Password) {
          // carry out form processing
}

How does checkLogin know what the values of Username and Password are, Would I still need to use something like $_POST, $_GET or $_REQUEST ?

I appreciate the help as this is the one aspect of OOP PHP that really baffles me...

Thanks

I think you should do something like this on the next page...

$object=new registerClass();
$object->checkLogin($_POST['Username'], $_POST[Password]);
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.