Beste,
Ik heb even een vraag. Ik heb het onderstaande script. Maar hoe kan ik de functie GetCredentials opdelen? Dat als ik bijv. vraag GetCredentials($user), dat ik dan alleen de username terug krijg?
Ik heb even een vraag. Ik heb het onderstaande script. Maar hoe kan ik de functie GetCredentials opdelen? Dat als ik bijv. vraag GetCredentials($user), dat ik dan alleen de username terug krijg?
[COLOR= #0000BB]<?php[/COLOR]
[COLOR= #FF8000]/**
* This class holds the settings for the DirectAmin API
*/[/COLOR]
[URL="http://www.php.net/class"]class[/URL] DirectAdmin_Api
[COLOR= #007700]{
var[/COLOR] [COLOR= #0000BB]$user[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #DD0000]"username"[/COLOR][COLOR= #007700];[/COLOR] [COLOR= #FF8000]// The username you log into DirectAdmin[/COLOR]
[COLOR= #007700]var[/COLOR] [COLOR= #0000BB]$pass[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #DD0000]"password"[/COLOR][COLOR= #007700];[/COLOR] [COLOR= #FF8000]// The password of your DirectAdmin account[/COLOR]
[URL="http://www.php.net/public"]public[/URL] [COLOR= #007700]function[/COLOR] GetCredentials[COLOR= #007700]()
{[/COLOR]
[URL="http://www.php.net/echo"]echo[/URL] [COLOR= #0000BB]$this[/COLOR][COLOR= #007700]->[/COLOR]user[COLOR= #007700];[/COLOR]
[URL="http://www.php.net/echo"]echo[/URL] [COLOR= #0000BB]$this[/COLOR][COLOR= #007700]->[/COLOR]pass[COLOR= #007700];
}
}[/COLOR]
[COLOR= #0000BB]$obj[/COLOR] [COLOR= #007700]= new[/COLOR] DirectAdmin_Api[COLOR= #007700]();[/COLOR]
[COLOR= #0000BB]$obj[/COLOR][COLOR= #007700]->[/COLOR]GetCredentials[COLOR= #007700]();[/COLOR]
?> 