magnus127
04-29-2003, 06:48 PM
I know I've posted about this before, but the conversation changed enough I think I should start a new thread.
I'm trying to integrate 2 php scripts...the first is PostNuke - CMS, the second is a pop mail account creation script. The pop mail script works by connecting to my Cpanel to make the user. I'm new to php, but it seems to me to be a fairly task to add the specific lines of script to make it work...take a look at the signup script below. Couldn't I nearly cut/paste the sections that connect to cpanel and create a user into the Postnuke new user script? Specifically I'm looking at:
if(isset($newuser))
{
$newemail = "$newuser@$domain";
$mpassword = $password2;
$link = mysql_connect($dbhost, $dbuser, $dbpass);
mysql_select_db($dbname) or die("Could not select database");
$query="SELECT username FROM $dbusertbl WHERE((username = '$newuser'))";
$result= mysql_query($query,$link);
if(mysql_num_rows($result) ==0)
{
$query="INSERT INTO $dbusertbl(name,username,password,email) VALUES ('$name','$newuser','$password1','$replymail');";
mysql_query($query,$link);
$socket = fsockopen($host,2082);
$authstr = "$cpaneluser:$cpanelpass";
$pass = base64_encode($authstr);
$in = "GET /frontend/$cpaneltheme/mail/doaddpop.html?email=$newemail&domain=$domain&password=$mpassword&a=$quota\r\n HTTP/1.0\r\nAuthorization: Basic $pass \r\n";
fputs($socket,$in);
fclose( $socket );
?>
Take a look at the entire pop signup script here (http://quasitown.com/postmail/signup.txt) , and the PostNuke new user script is here (http://quasitown.com/postmail/user.txt) . I'm really not trying to get someone to do this for me....I want to learn it. I'm just not sure where to start, and any help would be greatly appreciated!!
I'm trying to integrate 2 php scripts...the first is PostNuke - CMS, the second is a pop mail account creation script. The pop mail script works by connecting to my Cpanel to make the user. I'm new to php, but it seems to me to be a fairly task to add the specific lines of script to make it work...take a look at the signup script below. Couldn't I nearly cut/paste the sections that connect to cpanel and create a user into the Postnuke new user script? Specifically I'm looking at:
if(isset($newuser))
{
$newemail = "$newuser@$domain";
$mpassword = $password2;
$link = mysql_connect($dbhost, $dbuser, $dbpass);
mysql_select_db($dbname) or die("Could not select database");
$query="SELECT username FROM $dbusertbl WHERE((username = '$newuser'))";
$result= mysql_query($query,$link);
if(mysql_num_rows($result) ==0)
{
$query="INSERT INTO $dbusertbl(name,username,password,email) VALUES ('$name','$newuser','$password1','$replymail');";
mysql_query($query,$link);
$socket = fsockopen($host,2082);
$authstr = "$cpaneluser:$cpanelpass";
$pass = base64_encode($authstr);
$in = "GET /frontend/$cpaneltheme/mail/doaddpop.html?email=$newemail&domain=$domain&password=$mpassword&a=$quota\r\n HTTP/1.0\r\nAuthorization: Basic $pass \r\n";
fputs($socket,$in);
fclose( $socket );
?>
Take a look at the entire pop signup script here (http://quasitown.com/postmail/signup.txt) , and the PostNuke new user script is here (http://quasitown.com/postmail/user.txt) . I'm really not trying to get someone to do this for me....I want to learn it. I'm just not sure where to start, and any help would be greatly appreciated!!