Community Forums
Connect with us on LinkedIn
+ Reply to Thread
Results 1 to 3 of 3
  1. #1
    Registered User
    Join Date
    Mar 2009
    Posts
    2

    Default postwwwacct Add user to MySQL Database

    I need to automatically add the username to a MySQL whenever an account is created, but I'm not having any luck. I know to use postwwwacct, but I can't get anything to work. Here is the code I have so far, any advice would be greatly appreciated.

    PHP Code:
    #!/usr/bin/php -q

    <?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);
    ?>

  2. #2
    Member WebScHoLaR's Avatar
    Join Date
    Dec 2005
    Location
    Planet Earth
    Posts
    506

    Default

    I can write a script for you that will do it what you need. Let me know if you still need it.

    Regards,
    WebScHoLaR

    WebHosting Blog: http://WebScHoLaR.net

  3. #3
    Registered User
    Join Date
    Mar 2009
    Posts
    2

    Default

    That would be great, PM me with details?

Similar Threads & Tags
Similar threads

  1. MySQL: add user to database
    By Kurieuo in forum cPanel Developers
    Replies: 7
    Last Post: 08-14-2010, 06:50 AM
  2. add user to database
    By ourweb in forum cPanel and WHM Discussions
    Replies: 1
    Last Post: 04-21-2009, 10:16 AM
  3. Cant add user to database
    By ykongbam in forum cPanel and WHM Discussions
    Replies: 2
    Last Post: 04-12-2008, 03:52 PM
  4. Can't create user to add them to a database
    By dsecrets in forum Database Discussions
    Replies: 4
    Last Post: 01-02-2008, 08:36 PM
Linkedin       Facebook       Twitter       RSS       Flickr       YouTube