0

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

2
Contributors
1
Reply
4
Views
6 Years
Discussion Span
Last Post by Setvir
0

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

$object=new registerClass();
$object->checkLogin($_POST['Username'], $_POST[Password]);

Edited by Setvir: n/a

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.