Branden Wagner Posted August 7, 2006 Share Posted August 7, 2006 [code]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"; include_once("db.class.php"); $db = new db(); $db->connect($this->db_host,$this->db_user,$this->db_pass,$this->db_name); $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) values('$email','$crypt','$password','$name','$home','$maildir')"; $db->query($query) or die(mysql_error()); $folder = $this->dirmail . $domain ."/skel"; system("cp -pr $folder $home"); return "User Added Successfully"; } else { return "Username in use"; } }[/code]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. Quote Link to comment Share on other sites More sharing options...
Caesar Posted August 7, 2006 Share Posted August 7, 2006 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...[code]<?php phpinfo();exit;?>[/code] Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.