Jump to content


Photo

PLEASE HELP


  • Please log in to reply
2 replies to this topic

#1 bob2006

bob2006
  • Members
  • PipPipPip
  • Advanced Member
  • 62 posts
  • LocationFlorida

Posted 01 September 2006 - 08:25 AM

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.co...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:$cppa...&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
--Sam Mesic--

#2 samshel

samshel
  • Members
  • PipPipPip
  • Advanced Member
  • 837 posts

Posted 01 September 2006 - 08:31 AM

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
Cheers,
SamShel
-----------------------------------------------
--: FUTURE IS LINUX :--
-----------------------------------------------

#3 bob2006

bob2006
  • Members
  • PipPipPip
  • Advanced Member
  • 62 posts
  • LocationFlorida

Posted 01 September 2006 - 08:42 AM

thank you
--Sam Mesic--




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users