Jump to content


This topic is now archived and is closed to further replies.

Branden Wagner

correct but... incorrect?

Recommended Posts

function add_user($email,$password)
                $split = explode("@", $email);
                $username = $split[0];
                $domain = $split[1];
                $home = "/mail/virtual/". $domain ."/". $username;
                $maildir = $home ."/Maildir/";
                $crypt = $this->crypt_pass($password);
                $name = "user";

                $db = new db();
                $query = $db->query("select * from users where id='".$email."'");
                $num = $db->num_rows($query);

                if($num == 0)         
                        $query = "insert into users(id,crypt,clear,name,home,maildir)
                        $db->query($query) or die(mysql_error());
                        $folder = $this->dirmail . $domain ."/skel";
                        system("cp -pr $folder $home");   
                        return "User Added Successfully";
                        return "Username in use";

OK 2 problems. first for some reason clear is not inserting.. it just goes in blank and i cant figure out why.
second the crypt password is not inserting properly.. the function generates a correct password that works, i know this becuase if i run the function manually and take its output and manually insert it into the DB it works however the script here doesnt insert the crypted password properly.

im sure theres 2 problems are related.

Share this post

Link to post
Share on other sites
Blank page? Is "display_errors" set to "Off" in your php.ini file? Add the following line to the top of your PHP script and check...




Share this post

Link to post
Share on other sites


Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.