Jump to content

Archived

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

bob2006

PLEASE HELP

Recommended Posts

Hello I have a scrpits that set up email account with cpanel but the virbale are not carring over here are the scripts

<?php


echo("<table align='center'>
<form action=' cpemail.php' method='POST'>
<tr><td>UserName:</td><td><input type='text' name='user'></td></tr>
<tr><td>Password:</td><td><input type='password' name='pass'></td></tr>
<tr><td><input type='submit' name='submit' value='Submit'></td></tr>
</form>
</table>");
?>

and
<?php

###############################################################
# cPanel Email Account Creator 1.0
###############################################################
# Visit http://www.zubrag.com/scripts/ for updates
###############################################################
# You can pass following parameters in calling URL. They will
# override those specified below.
# user - new email user
# pass - password
# domain - email domain
# quota - email quota, Mb
# Example: cpemail.php?user=newuser&pass=password&quota=50
###############################################################

// cPanel info
$cpuser = '****'; // cPanel username
$cppass = '****'; // cPanel password
$cpdomain = 'bob.tdsnet.org'; // cPanel domain or IP
$cpskin = 'x2';  // cPanel skin. Mostly x or x2.
// See following URL to know how to determine your cPanel skin
// http://www.zubrag.com/articles/determine-cpanel-skin.php

// Default email info for new email accounts
// These will only be used if not passed via URL
$euser = 'user'; // email username (without @ and domain)
$epass = 'pass'; // email password
$edomain = 'bob.tdsnet.org'; // email domain (usually same as cPanel domain above)
$equota = 20; // amount of space in megabytes

###############################################################
# END OF SETTINGS
###############################################################

function getVar($name, $def = '') {
  if (isset($_GET[$name]))
    return $_GET[$name];
  else
    return $def;
}

// check if overrides passed
$euser = getVar('user', $euser);
$epass = getVar('pass', $epass);
$edomain = getVar('domain', $edomain);
$equota = getVar('quota', $equota);

// Create email account
$f = fopen ("http://$cpuser:$cppass@$cpdomain:2082/frontend/$cpskin/mail/doaddpop.html?email=$euser&domain=$edomain&password=$epass&quota=$equota", "r");
if (!$f) {
  die('Cannot create email account. Possible reasons: "fopen" function allowed on your server, PHP is running in SAFE mode');
}

// Check result
while (!feof ($f)) {
  $line = fgets ($f, 1024);
  if (ereg ("already exists!", $line, $out)) {
    die('Such email account already exists.');
  }
}
fclose($f);

echo "Email account created.";

?>
please help

Share this post


Link to post
Share on other sites
Hello,

The script needs checks for variables in GET and the form you submit has a POST method. Change the method of the form to 'GET'.

hth

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.