Tema: Formulario
Ver Mensaje Individual
  #7 (permalink)  
Antiguo 06/03/2007, 14:30
mmontanez
 
Fecha de Ingreso: septiembre-2005
Mensajes: 75
Antigüedad: 18 años, 8 meses
Puntos: 0
Re: Formulario

No tuve suerte, se ve que algún disparate estoy haciendo.

Tengo 2 archivos:

formulario.php

<form method="POST" action="cpemail.php">
<input type="text" name="variable_usuario" size="20"></p>
<p><input type="text" name="variable_password" size="20"></p>
<p><input type="submit" value="Enviar"><input type="reset" value="Restablecer"></p>
</form>

Y cpemail.php

<?php
$variable_usuario = $_POST['NEWUSER'];
$variable_password=$_POST['PASSWORD'];


################################################## #############
# 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 = '---'; // cPanel domain or IP
$cpskin = '---'; // cPanel skin. Mostly x or x2.
// See following URL to know how to determine your cPanel skin
// http://www.zubrag.com/articles/deter...panel-skin.php

// Default email info for new email accounts
// These will only be used if not passed via URL
$euser = 'newuser'; // email username (without @ and domain)
$epass = 'hispassword'; // email password
$edomain = 'mysite.com'; // 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&passwor d=$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.";

?>

No llegan los valores. El contenido del cpemail.php no lo hice yo, solo lo de arriba que me dijiste.

Desde ya, muchas gracias.

Última edición por mmontanez; 07/03/2007 a las 18:37