Ambiera Forum

Discussions, Help and Support.

Ambiera Forum > WebsitePainter

Registered User
2019-01-30 21:29:46

Below is the simplest registration code on php for those who need it.

<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
* { font-family:arial; font-size:10pt;}
td, th {
padding: 18px;
td border: thin solid black;text-align: left;
<form action="registration.php" method="POST" />
<tr><td><input type="text" size="20" name="Surname"/></td><td><input type="text" size="20" name="Name"/></td><td><input type="text" size="20" name="Patronymic"/></td><td><input type="text" size="20" name="Birthdate"/></td><td><input type="text" size="20" name="Login"/></td><td><input type="Password" size="20" maxlength="20" name="Password"/></td><td><input type="text" size="20" name="Email"/></td><td><input type="text" size="20" name="Phone"/></td></tr>
<td colspan="2"><input class="button" type="submit" value="To register" name="submit" /></td>
$connection = mysqli_connect('host', 'user', 'password', 'db') or die(mysqli_error($connection));
if (isset($_POST['submit']))
if (empty($_POST['Surname']))
$info_reg = 'You did not enter a surname';
elseif (empty($_POST['Name']))
$info_reg = 'You have not entered a name';
elseif (empty($_POST['Birthdate']))
$info_reg = 'You did not enter a birthdate';
elseif (empty($_POST['Login']))
$info_reg = 'You have not entered a login';
elseif (empty($_POST['Password']))
$info_reg = 'You have not entered a password';
elseif (empty($_POST['Phone']))
$info_reg = 'You have not entered a mobile phone';
elseif (empty($_POST['Email']))
$info_reg = 'You did not enter the mail';
$Surname = $_POST['Surname'];
$Name = $_POST['Name'];
$Patronymic = $_POST['Patronymic'];
$Birthdate = $_POST['Birthdate'];
$Login = $_POST['Login'];
$Password = $_POST['Password'];
$Phone = $_POST['Phone'];
$Email = $_POST['Email'];
$query = "INSERT INTO `Reg` (Surname, Name, Patronymic, Birthdate, Login, Password, Phone, Email)
VALUES ('$Surname', '$Name', '$Patronymic', '$Birthdate', '$Login', '$Password', '$Phone', '$Email')";
$result = mysqli_query($connection, $query) or die(mysqli_error($connection));
$info_reg = '<div style="position:absolute; left:15%">Registration successful</div>';
$info_reg = isset($info_reg) ? $info_reg : NULL;
echo $info_reg;

Create reply:

Posted by: (you are not logged in)

Enter the missing letter in: "Internati?nal" (you are not logged in)




Possible Codes

Feature Code
Link [url] [/url]
Bold [b]bold text[/b]
Image [img][/img]
Quote [quote]quoted text[/quote]
Code [code]source code[/code]



Copyright© Ambiera e.U. all rights reserved.
Privacy Policy | Terms and Conditions | Imprint | Contact