Topic: PHP / HTML Register Form
==== REQUIRED BASIC INFO OF YOUR IREDMAIL SERVER ====
- iRedMail version 0.9.8:
- Linux/BSD distribution Ubuntu 18.04 x64:
- Store mail accounts in MySQL:
- Web server Nginx:
- Manage mail accounts with iRedAdmin-Pro? No
- [IMPORTANT] Related original log or error message is required if you're experiencing an issue.
====
Hello, I have created a very simple form to allow other members of my team to create their own email accounts but it does not seem to be working and I'm not sure what the mistake could be.
Also, not too sure if support for this kind of issue is provided here.
After I click submit on the form, the webpage just loads forever and no email account is created. Any help would be greatly appreciated.
This is the form:
<html>
<body>
<?php
if(isset($_POST['add'])) {
$dbhost = 'IP';
$dbuser = 'root';
$dbpass = 'password';
$dbname = 'vmail';
$conn = mysql_connect($dbhost, $dbuser, $dbpass, $dbname);
if(! $conn ) { die('Could not connect: ' . mysql_error()); }
if(! get_magic_quotes_gpc() ) {
$STORAGE_BASE = "$(dirname $[STORAGE_BASE_DIRECTORY])";
$STORAGE_NODE = "$(basename $[STORAGE_BASE_DIRECTORY])";
$username = addslashes ($_POST['username']);
$domain = addslashes ($_POST['domain']);
$password = $_POST['password']; }
$sql = "INSERT INTO mailbox ". "(username,password,name,storagebasedirectory,storagenode,quota,domain,active,passwordlastchange,created) ". "VALUES('$username@$domain', '$password', '$username', '$STORAGE_BASE','$STORAGE_NODE', '100', '$domain', '1', NOW(), NOW())";
mysql_close($conn); }else { ?>
<form method = "post" action = "<?php $_PHP_SELF ?>">
<table width = "400" border = "0" cellspacing = "1" cellpadding = "2">
<tr>
<td width = "100">User Name</td>
<td><input name = "username" type = "text" id = "username"></td>
</tr>
<tr>
<td width = "100">Domain</td>
<td><input name = "domain" type = "text" id = "domain"></td>
</tr>
<tr>
<td width = "100">Password</td>
<td><input name = "password" type = "text" id = "password"></td>
</tr>
<tr>
<td width = "100"> </td>
<td> </td>
</tr>
<tr>
<td width = "100"> </td>
<td>
<input name = "add" type = "submit" id = "add" value = "Add Email">
</td>
</tr>
</table>
</form>
<?php}?>
</body>
</html>
----
Spider Email Archiver: On-Premises, lightweight email archiving software developed by iRedMail team. Supports Amazon S3 compatible storage and custom branding.