Hi there everyone! I have been to a few of your meetings when I was
attending Natcoll, and I thought you might be able to help me.
I need to write a postwwwacct script (with PHP) that adds the username
and a default password to a MySQL database whenever a new account is
created in WHM. This is what I've written, that doesn't really work.
At all.
[PHP]
#!/usr/bin/php
<?php
require_once('/home/diy/public_html/assets/config.php');
require_once('/home/diy/public_html/assets/dbclass.php');
require_once('/home/diy/public_html/assets/formFunctionsV2.0.php');
$a = new makeForm($dbConArray);
$opts = array();
$argv0 = array_shift($argv);
while(count($argv)) {
$key = array_shift($argv);
$value = array_shift($argv);
$opts[$key] = $value;
}
//Get username, store in a variable
$diyUsername = $opts['user'];
//Create password from username, store in a variable
$diyPassword = $opts['user'].'77';
//Insert account ($opts['user']), username and password into clients
database
$q = "INSERT INTO tbl_accounts (username,password,account) VALUES ('".
$diyUsername."','".$diyPassword."','".$diyUsername."')";
$a->query($q);
?>
[/PHP]
Any help would be GREATLY appreciated.
Thanks!
Caleb
--~--~---------~--~----~------------~-------~--~----~
NZ PHP Users Group: http://groups.google.com/group/nzphpug
To post, send email to [email protected]
To unsubscribe, send email to
[email protected]
-~----------~----~----~----~------~----~------~--~---