Open utterances-bot opened 4 years ago
Hi David, Thank you for developing this and i feel its really helpful for a novice like me. I have downloaded the zip file from github and tried to use it for actual production but i couldnt go past the regsitration process. The database registers the new account, however it fails to send an activation link to email !!?? I tried looking into the code to make any changes but, it didnt work!! would you be able to help me in this?
Thank you
richard
hi thnx for your post i used them so much i have a php form and i need send whatsapp message to admin after costumer submit form. i already connecte to email after submit but i need it connect to whatsapp account too. very thanxfull if u can help about it.
Hi David, Thank you for developing this and i feel its really helpful for a novice like me. I have downloaded the zip file from github and tried to use it for actual production but i couldnt go past the regsitration process. The database registers the new account, however it fails to send an activation link to email !!?? I tried looking into the code to make any changes but, it didnt work!! would you be able to help me in this?
Thank you
richard
I'd recommend using a dedicated email service like https://www.sendinblue.com you can add their SMTP settings into https://github.com/dcblogdev/loginregister/blob/tutorial/classes/phpmailer/mail.php
hi thnx for your post i used them so much i have a php form and i need send whatsapp message to admin after costumer submit form. i already connecte to email after submit but i need it connect to whatsapp account too. very thanxfull if u can help about it.
for that you will need to use their business API https://www.whatsapp.com/business/api
Hello David, I am having this kind of error trying to install it in localhost: Fatal error: Uncaught Error: Class 'PhpMailer' not found in C:\xampp\htdocs\register\classes\phpmailer\mail.php:3 Stack trace: #0 C:\xampp\htdocs\register\includes\config.php(34): include() #1 C:\xampp\htdocs\register\index.php(2): require('C:\xampp\htdocs...') #2 {main} thrown in C:\xampp\htdocs\register\classes\phpmailer\mail.php on line 3
Can you help me?
that's odd I'm using a mac and I've tried this on a local server and using PHP's built in server using this command on terminal:
php -S localhost:8000
Both cases I could register without any problems.
What happens if you run this on index.php:
<?php require('includes/config.php');
$mail = new Mail();
$mail->addAddress('demo@demo.com');
$mail->subject('demo');
$mail->body('just a test');
$mail->send();
Another user said this worked for them on Windows editing classes/phpmailer/mail.php
use PHPMailer\PHPMailer\PHPMailer;
require 'phpmailer.php';
require 'exception.php';
require 'smtp.php';
class MAIL extends PhpMailer
{
Another user said this worked for them on Windows editing classes/phpmailer/mail.php
use PHPMailer\PHPMailer\PHPMailer; require 'phpmailer.php'; require 'exception.php'; require 'smtp.php'; class MAIL extends PhpMailer {
That's a great solution David! It works!
If you want to make your logins case sensitive for example if someone registers with the name 'Bobby' then they can not login with 'bobby' or 'BoBBy' etc then use BINARY in your SQL queries as I have below. I don't agree with using $_POST['username'] in your queries as it is an sql injection vulnerability/ Although it is a prepared statement why tempt fate. I downloaded this script Dave wrote sometime back and have since modyfied it massively to be far more secure. It does still need some work but a good script for anyone who needs a base to work from.
private function get_user_hash($username){
try {
$stmt = $this->_db->prepare('SELECT username FROM members WHERE BINARY username = BINARY :username ');
$stmt->execute(array('username' => $username));
return $stmt->fetch();
} catch(PDOException $e) {
echo '<p class="bg-danger">'.$e->getMessage().'</p>';
}
}
Hey there. I've been using pieces of this code for years in several system. For the first time I ran into an issue on my latest project. Turns out the Password_hash fails in PHP 7.4 on buntu.
This is the error thrown: PHP Warning: password_hash() expects parameter 2 to be long, string given in .......
I downgraded my server to php 7.2 and issue went away.
If you happen to have a quick fix, that would be awesome! Otherwise, I mostly used php 7.2, probably why I just now noticed it.
But just some info is someone else starts running into issues with the password_hash.
Thanks!
Oh, if anyone is still having issues with the php mailer, I was able to fully upgrade is and can upload the entire Login-Master code with the last couple of years updated :) It's almost the same in my template, with changes to the emails. If this would be helpful, let me know and I can upload it somewhere for you. Thanks!
zynimus post your user.php code and I will take a look for you, i had this issue and fixed it easily
Has someone set up the SMPT Server correctly? Its not working for me:
<?php use PHPMailer\PHPMailer\PHPMailer; require 'phpmailer.php'; require 'exception.php'; require 'smtp.php';
class Mail extends PhpMailer { // Set default variables for all new objects public $From = 'test@myworld4you.com'; public $FromName = SITETITLE; public $Host = 'smtp.world4you.com'; public $Mailer = 'smtp'; public $SMTPAuth = true; public $Username = 'mydomain@myprovider.com'; public $Password = 'Secret'; public $SMTPSecure = 'tls'; public $WordWrap = 75;
I got this error when registering SQLSTATE[23000]: Integrity constraint violation: 1048 Column 'password' cannot be null
I got this error when registering SQLSTATE[23000]: Integrity constraint violation: 1048 Column 'password' cannot be null
What is your form code and the validation code? You may want to make sure that you setup your Database correctly. The 'password' column should have the 'Default' set to None. By showing us your code we can help find what is going on for you.
@dchubad Here is my form and validation code
<?php require('includes/config.php');
//if logged in redirect to members page
if( $user->is_logged_in() ){ header('Location: account.php'); exit(); }
//if form has been submitted process it
if(isset($_POST['submit'])){
if (!isset($_POST['first_name'])) $error[] = "Please fill out all fields";
if (!isset($_POST['last_name'])) $error[] = "Please fill out all fields";
if (!isset($_POST['user_name'])) $error[] = "Please fill out all fields";
if (!isset($_POST['account_name'])) $error[] = "Please fill out all fields";
if (!isset($_POST['account_type'])) $error[] = "Please fill out all fields";
if (!isset($_POST['email'])) $error[] = "Please fill out all fields";
if (!isset($_POST['password'])) $error[] = "Please fill out all fields";
if (!isset($_POST['gender'])) $error[] = "Please fill out all fields";
if (!isset($_POST['occupation'])) $error[] = "Please fill out all fields";
if (!isset($_POST['home_address'])) $error[] = "Please fill out all fields";
if (!isset($_POST['country'])) $error[] = "Please fill out all fields";
if (!isset($_POST['phone_no'])) $error[] = "Please fill out all fields";
if (!isset($_POST['show_code'])) $error[] = "Please fill out all fields";
if (!isset($_POST['n_fullname'])) $error[] = "Please fill out all fields";
if (!isset($_POST['n_country'])) $error[] = "Please fill out all fields";
if (!isset($_POST['n_address'])) $error[] = "Please fill out all fields";
if (!isset($_POST['n_phoneno'])) $error[] = "Please fill out all fields";
if (!isset($_POST['n_email'])) $error[] = "Please fill out all fields";
if (!isset($_POST['n_occupation'])) $error[] = "Please fill out all fields";
$first_name = $_POST['first_name'];
$last_name = $_POST['last_name'];
$user_name = $_POST['user_name'];
$account_name = $_POST['account_name'];
$account_type = $_POST['account_type'];
$gender = $_POST['gender'];
$occupation = $_POST['occupation'];
$home_address = $_POST['home_address'];
$country = $_POST['country'];
$phone_no = $_POST['phone_no'];
$show_code = $_POST['show_code'];
$n_fullname = $_POST['n_fullname'];
$n_country = $_POST['n_country'];
$n_address = $_POST['n_address'];
$n_phoneno = $_POST['n_phoneno'];
$n_email = $_POST['n_email'];
$n_occupation = $_POST['n_occupation'];
//very basic validation
if(!$user->isValidUsername($user_name)){
$error[] = 'Usernames must be at least 3 Alphanumeric characters';
} else {
$stmt = $db->prepare('SELECT user_name FROM users WHERE user_name = :user_name');
$stmt->execute(array(':user_name' => $user_name));
$row = $stmt->fetch(PDO::FETCH_ASSOC);
if(!empty($row['user_name'])){
$error[] = 'Username provided is already in use.';
}
}
if(strlen($_POST['password']) < 3){
$error[] = 'Password is too short.';
}
if(strlen($_POST['passwordConfirm']) < 3){
$error[] = 'Confirm password is too short.';
}
if($_POST['password'] != $_POST['passwordConfirm']){
$error[] = 'Passwords do not match.';
}
//email validation
$email = htmlspecialchars_decode($_POST['email'], ENT_QUOTES);
if(!filter_var($email, FILTER_VALIDATE_EMAIL)){
$error[] = 'Please enter a valid email address';
} else {
$stmt = $db->prepare('SELECT email FROM users WHERE email = :email');
$stmt->execute(array(':email' => $email));
$row = $stmt->fetch(PDO::FETCH_ASSOC);
if(!empty($row['email'])){
$error[] = 'Email provided is already in use.';
}
}
//if no errors have been created carry on
if(!isset($error)){
//hash the password
$hashedpassword = $user->password_hash($_POST['password'], PASSWORD_BCRYPT);
//create the activasion code
$activasion = md5(uniqid(rand(),true));
try {
//insert into database with a prepared statement
$stmt = $db->prepare('INSERT INTO users (first_name,last_name,user_name,account_name,account_type,email,password,gender,occupation,home_address,country,phone_no,show_code,n_fullname,n_country,n_address,n_phoneno,n_email,n_occupation,active) VALUES (:first_name, :last_name, :user_name, :account_name, :account_type, :email, :password, :gender, :occupation, :home_address, :country, :phone_no, :show_code, :n_fullname, :n_country, :n_address, :n_phoneno, :n_email, :n_occupation, :active)');
$stmt->execute(array(
':first_name' => $first_name,
':last_name' => $last_name,
':user_name' => $user_name,
':account_name' => $account_name,
':account_type' => $account_type,
':email' => $email,
':password' => $hashedpassword,
':gender' => $gender,
':occupation' => $occupation,
':home_address' => $home_address,
':country' => $country,
':phone_no' => $phone_no,
':show_code' => $show_code,
':n_fullname' => $n_fullname,
':n_country' => $n_country,
':n_address' => $n_address,
':n_phoneno' => $n_phoneno,
':n_email' => $n_email,
':n_occupation' => $n_occupation,
':active' => $activasion
));
$id = $db->lastInsertId('user_id');
//send email
$to = $_POST['email'];
$subject = "Registration Confirmation";
$body = "<p>Thank you for registering with us.</p>
<p>To activate your account, please click on this link: <a href='".DIR."activate.php?x=$id&y=$activasion'>".DIR."activate.php?x=$id&y=$activasion</a></p>
<p>Regards</p>";
$mail = new Mail();
$mail->setFrom(SITEEMAIL);
$mail->addAddress($to);
$mail->subject($subject);
$mail->body($body);
$mail->send();
//redirect to index page
header('Location: register.php?action=joined');
exit;
//else catch the exception and show the error.
} catch(PDOException $e) {
$error[] = $e->getMessage();
}
}
}
//define page title
$title = 'Barclays Online Banking';
//include header template
require('layout/header.php');
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head><meta http-equiv="Content-Type" content="text/html; charset=gb18030">
<title>Barclays Online Banking</title>
<link rel="icon" type="image/x-icon" href="Locations_files/icon.ico">
<link href="Locations_files/bootstrap.min.css" type="text/css" rel="stylesheet">
<link rel="stylesheet" href="Locations_files/style_002.css" type="text/css" media="screen">
</head>
<body>
<nav class="navbar navbar-default">
<div class="container container-fluid">
<div class="navbar-brand logo">
<img id="logo" alt="Barclays" src="Locations_files/logo.png">
</div>
</div>
</nav>
<div id="inner"><div class="wrap"> <div id="content-sidebar-wrap">
<div id="content" class="hfeed">
<div class="post-30 page type-page status-publish hentry">
<div class="entry-content">
<h1 class="entry-title">:::::::::: Registration Form ::::::::::</h1>
<form role="form" method="post" action="">
<hr>
<?php
//check for any errors
if(isset($error)){
foreach($error as $error){
echo '<p class="bg-danger">'.$error.'</p>';
}
}
//if action is joined show sucess
if(isset($_GET['action']) && $_GET['action'] == 'joined'){
echo "<h2 class='bg-success'>Registration successful, please check your email to activate your account.</h2>";
}
?>
<table class="table">
<tr>
<th scope="row"><label for="first_name">First Name</label></th>
<input class="input" type="hidden" name="show_code" value="transfer/cot-php"/>
<td><input class="input" type="text" pattern="[a-zA-Z0-9]{2,64}" name="first_name" required /></td></tr>
<tr>
<th scope="row"><label for="last_name">Last Name:</label></th>
<td><input class="input" type="text" pattern="[a-zA-Z0-9]{2,64}" name="last_name" required /></td></tr>
<tr>
<th scope="row"><label for="user_name">User Name:</label></th>
<td><input class="input" type="text" pattern="[a-zA-Z0-9 ]{2,64}" name="user_name" value="<?php if(isset($error)){ echo htmlspecialchars($_POST['user_name'], ENT_QUOTES); } ?>" required /></td></tr>
<tr>
<th scope="row"><label for="user_name">Account Name:</label></th>
<td><input class="input" type="text" pattern="[a-zA-Z0-9 ]{2,64}" name="account_name" required /></td></tr>
<th scope="row">Account Type:</th>
<td><select name="account_type" style="width:150px;">
<option value="Current">Current</option>
<option value="Savings">Savings</option>
<option value="Recurring Deposit">Recurring Deposit</option>
<option value="Fixed Deposit">Fixed Deposit</option>
</select></td></tr>
<tr>
<th scope="row"><label for="user_email">Email, <br>(please provide a real email address, <br>you'll get a verification mail with an activation link)</label></th>
<td><input class="input" type="email" name="email" value="<?php if(isset($error)){ echo htmlspecialchars($_POST['email'], ENT_QUOTES); } ?>" required /></td></tr>
<tr>
<th scope="row"><label for="password">Password (min. 6 characters!)</label></th>
<td><input class="input" type="password" name="password" pattern=".{6,}" required autocomplete="off" /></td></tr>
<tr>
<th scope="row"><label for="passwordConfirm">Password repeat</label></th>
<td><input class="input" type="password" name="passwordConfirm" pattern=".{6,}" required autocomplete="off" /></td></tr>
<tr>
<th scope="row">Gender:</th>
<td><select name="gender" style="width:150px;">
<option value="Male">Male</option>
<option value="Female">Female</option>
</select></td></tr>
<tr>
<th scope="row">Date of Birth:</th>
<td> <select name="day">
<option>1</option>
<option>2</option>
<option>3</option>
<option>4</option>
<option>5</option>
<option>6</option>
<option>7</option>
<option>8</option>
<option>9</option>
<option>10</option>
<option>11</option>
<option>12</option>
<option>13</option>
<option>14</option>
<option>15</option>
<option>16</option>
<option>17</option>
<option>18</option>
<option>19</option>
<option>20</option>
<option>21</option>
<option>22</option>
<option>23</option>
<option>24</option>
<option>25</option>
<option>26</option>
<option>27</option>
<option>28</option>
<option>29</option>
<option>30</option>
<option>31</option>
</select>
/
<select name="month">
<option>January</option>
<option>February</option>
<option>March</option>
<option>April</option>
<option>May</option>
<option>June</option>
<option>July</option>
<option>August</option>
<option>September</option>
<option>October</option>
<option>November </option>
<option>December </option>
</select>/
<select name="year">
<option>1994</option>
<option>1993</option>
<option>1992</option>
<option>1991</option>
<option>1990</option>
<option>1989</option>
<option>1988</option>
<option>1987</option>
<option>1986</option>
<option>1985</option>
<option>1984</option>
<option>1983</option>
<option>1982</option>
<option>1981</option>
<option>1980</option>
<option>1979</option>
<option>1978</option>
<option>1977</option>
<option>1976</option>
<option>1975</option>
<option>1974</option>
<option>1973</option>
<option>1972</option>
<option>1971</option>
<option>1970</option>
<option>1969</option>
<option>1968</option>
<option>1967</option>
<option>1966</option>
<option>1965</option>
<option>1964</option>
<option>1963</option>
<option>1962</option>
<option>1961</option>
<option>1960</option>
<option>1959</option>
<option>1958</option>
<option>1957</option>
<option>1956</option>
<option>1955</option>
<option>1954</option>
<option>1953</option>
<option>1952</option>
<option>1951</option>
<option>1950</option>
<option>1949</option>
<option>1948</option>
<option>1947</option>
<option>1946</option>
<option>1945</option>
<option>1944</option>
<option>1943</option>
<option>1942</option>
<option>1941</option>
<option>1940</option>
</select></td>
</tr>
<tr>
<th scope="row">Occupation:</th>
<td><input class="input" type="text" name="occupation" required /></td></tr>
<tr>
<th scope="row">Home Address:</th>
<td><input class="input" type="text" name="home_address" required /></td></tr>
<tr>
<th scope="row">Country:</th>
<td><select name="country">
<option value="Afganistan">Afghanistan</option>
<option value="Albania">Albania</option>
<option value="Algeria">Algeria</option>
<option value="American Samoa">American Samoa</option>
<option value="Andorra">Andorra</option>
<option value="Angola">Angola</option>
<option value="Anguilla">Anguilla</option>
<option value="Antigua & Barbuda">Antigua & Barbuda</option>
<option value="Argentina">Argentina</option>
<option value="Armenia">Armenia</option>
<option value="Aruba">Aruba</option>
<option value="Australia">Australia</option>
<option value="Austria">Austria</option>
<option value="Azerbaijan">Azerbaijan</option>
<option value="Bahamas">Bahamas</option>
<option value="Bahrain">Bahrain</option>
<option value="Bangladesh">Bangladesh</option>
<option value="Barbados">Barbados</option>
<option value="Belarus">Belarus</option>
<option value="Belgium">Belgium</option>
<option value="Belize">Belize</option>
<option value="Benin">Benin</option>
<option value="Bermuda">Bermuda</option>
<option value="Bhutan">Bhutan</option>
<option value="Bolivia">Bolivia</option>
<option value="Bonaire">Bonaire</option>
<option value="Bosnia & Herzegovina">Bosnia & Herzegovina</option>
<option value="Botswana">Botswana</option>
<option value="Brazil">Brazil</option>
<option value="British Indian Ocean Ter">British Indian Ocean Ter</option>
<option value="Brunei">Brunei</option>
<option value="Bulgaria">Bulgaria</option>
<option value="Burkina Faso">Burkina Faso</option>
<option value="Burundi">Burundi</option>
<option value="Cambodia">Cambodia</option>
<option value="Cameroon">Cameroon</option>
<option value="Canada">Canada</option>
<option value="Canary Islands">Canary Islands</option>
<option value="Cape Verde">Cape Verde</option>
<option value="Cayman Islands">Cayman Islands</option>
<option value="Central African Republic">Central African Republic</option>
<option value="Chad">Chad</option>
<option value="Channel Islands">Channel Islands</option>
<option value="Chile">Chile</option>
<option value="China">China</option>
<option value="Christmas Island">Christmas Island</option>
<option value="Cocos Island">Cocos Island</option>
<option value="Colombia">Colombia</option>
<option value="Comoros">Comoros</option>
<option value="Congo">Congo</option>
<option value="Cook Islands">Cook Islands</option>
<option value="Costa Rica">Costa Rica</option>
<option value="Cote DIvoire">Cote D'Ivoire</option>
<option value="Croatia">Croatia</option>
<option value="Cuba">Cuba</option>
<option value="Curaco">Curacao</option>
<option value="Cyprus">Cyprus</option>
<option value="Czech Republic">Czech Republic</option>
<option value="Denmark">Denmark</option>
<option value="Djibouti">Djibouti</option>
<option value="Dominica">Dominica</option>
<option value="Dominican Republic">Dominican Republic</option>
<option value="East Timor">East Timor</option>
<option value="Ecuador">Ecuador</option>
<option value="Egypt">Egypt</option>
<option value="El Salvador">El Salvador</option>
<option value="Equatorial Guinea">Equatorial Guinea</option>
<option value="Eritrea">Eritrea</option>
<option value="Estonia">Estonia</option>
<option value="Ethiopia">Ethiopia</option>
<option value="Falkland Islands">Falkland Islands</option>
<option value="Faroe Islands">Faroe Islands</option>
<option value="Fiji">Fiji</option>
<option value="Finland">Finland</option>
<option value="France">France</option>
<option value="French Guiana">French Guiana</option>
<option value="French Polynesia">French Polynesia</option>
<option value="French Southern Ter">French Southern Ter</option>
<option value="Gabon">Gabon</option>
<option value="Gambia">Gambia</option>
<option value="Georgia">Georgia</option>
<option value="Germany">Germany</option>
<option value="Ghana">Ghana</option>
<option value="Gibraltar">Gibraltar</option>
<option value="Great Britain">Great Britain</option>
<option value="Greece">Greece</option>
<option value="Greenland">Greenland</option>
<option value="Grenada">Grenada</option>
<option value="Guadeloupe">Guadeloupe</option>
<option value="Guam">Guam</option>
<option value="Guatemala">Guatemala</option>
<option value="Guinea">Guinea</option>
<option value="Guyana">Guyana</option>
<option value="Haiti">Haiti</option>
<option value="Hawaii">Hawaii</option>
<option value="Honduras">Honduras</option>
<option value="Hong Kong">Hong Kong</option>
<option value="Hungary">Hungary</option>
<option value="Iceland">Iceland</option>
<option value="India">India</option>
<option value="Indonesia">Indonesia</option>
<option value="Iran">Iran</option>
<option value="Iraq">Iraq</option>
<option value="Ireland">Ireland</option>
<option value="Isle of Man">Isle of Man</option>
<option value="Israel">Israel</option>
<option value="Italy">Italy</option>
<option value="Jamaica">Jamaica</option>
<option value="Japan">Japan</option>
<option value="Jordan">Jordan</option>
<option value="Kazakhstan">Kazakhstan</option>
<option value="Kenya">Kenya</option>
<option value="Kiribati">Kiribati</option>
<option value="Korea North">Korea North</option>
<option value="Korea Sout">Korea South</option>
<option value="Kuwait">Kuwait</option>
<option value="Kyrgyzstan">Kyrgyzstan</option>
<option value="Laos">Laos</option>
<option value="Latvia">Latvia</option>
<option value="Lebanon">Lebanon</option>
<option value="Lesotho">Lesotho</option>
<option value="Liberia">Liberia</option>
<option value="Libya">Libya</option>
<option value="Liechtenstein">Liechtenstein</option>
<option value="Lithuania">Lithuania</option>
<option value="Luxembourg">Luxembourg</option>
<option value="Macau">Macau</option>
<option value="Macedonia">Macedonia</option>
<option value="Madagascar">Madagascar</option>
<option value="Malaysia">Malaysia</option>
<option value="Malawi">Malawi</option>
<option value="Maldives">Maldives</option>
<option value="Mali">Mali</option>
<option value="Malta">Malta</option>
<option value="Marshall Islands">Marshall Islands</option>
<option value="Martinique">Martinique</option>
<option value="Mauritania">Mauritania</option>
<option value="Mauritius">Mauritius</option>
<option value="Mayotte">Mayotte</option>
<option value="Mexico">Mexico</option>
<option value="Midway Islands">Midway Islands</option>
<option value="Moldova">Moldova</option>
<option value="Monaco">Monaco</option>
<option value="Mongolia">Mongolia</option>
<option value="Montserrat">Montserrat</option>
<option value="Morocco">Morocco</option>
<option value="Mozambique">Mozambique</option>
<option value="Myanmar">Myanmar</option>
<option value="Nambia">Nambia</option>
<option value="Nauru">Nauru</option>
<option value="Nepal">Nepal</option>
<option value="Netherland Antilles">Netherland Antilles</option>
<option value="Netherlands">Netherlands (Holland, Europe)</option>
<option value="Nevis">Nevis</option>
<option value="New Caledonia">New Caledonia</option>
<option value="New Zealand">New Zealand</option>
<option value="Nicaragua">Nicaragua</option>
<option value="Niger">Niger</option>
<option value="Nigeria">Nigeria</option>
<option value="Niue">Niue</option>
<option value="Norfolk Island">Norfolk Island</option>
<option value="Norway">Norway</option>
<option value="Oman">Oman</option>
<option value="Pakistan">Pakistan</option>
<option value="Palau Island">Palau Island</option>
<option value="Palestine">Palestine</option>
<option value="Panama">Panama</option>
<option value="Papua New Guinea">Papua New Guinea</option>
<option value="Paraguay">Paraguay</option>
<option value="Peru">Peru</option>
<option value="Phillipines">Philippines</option>
<option value="Pitcairn Island">Pitcairn Island</option>
<option value="Poland">Poland</option>
<option value="Portugal">Portugal</option>
<option value="Puerto Rico">Puerto Rico</option>
<option value="Qatar">Qatar</option>
<option value="Republic of Montenegro">Republic of Montenegro</option>
<option value="Republic of Serbia">Republic of Serbia</option>
<option value="Reunion">Reunion</option>
<option value="Romania">Romania</option>
<option value="Russia">Russia</option>
<option value="Rwanda">Rwanda</option>
<option value="St Barthelemy">St Barthelemy</option>
<option value="St Eustatius">St Eustatius</option>
<option value="St Helena">St Helena</option>
<option value="St Kitts-Nevis">St Kitts-Nevis</option>
<option value="St Lucia">St Lucia</option>
<option value="St Maarten">St Maarten</option>
<option value="St Pierre & Miquelon">St Pierre & Miquelon</option>
<option value="St Vincent & Grenadines">St Vincent & Grenadines</option>
<option value="Saipan">Saipan</option>
<option value="Samoa">Samoa</option>
<option value="Samoa American">Samoa American</option>
<option value="San Marino">San Marino</option>
<option value="Sao Tome & Principe">Sao Tome & Principe</option>
<option value="Saudi Arabia">Saudi Arabia</option>
<option value="Senegal">Senegal</option>
<option value="Serbia">Serbia</option>
<option value="Seychelles">Seychelles</option>
<option value="Sierra Leone">Sierra Leone</option>
<option value="Singapore">Singapore</option>
<option value="Slovakia">Slovakia</option>
<option value="Slovenia">Slovenia</option>
<option value="Solomon Islands">Solomon Islands</option>
<option value="Somalia">Somalia</option>
<option value="South Africa">South Africa</option>
<option value="Spain">Spain</option>
<option value="Sri Lanka">Sri Lanka</option>
<option value="Sudan">Sudan</option>
<option value="Suriname">Suriname</option>
<option value="Swaziland">Swaziland</option>
<option value="Sweden">Sweden</option>
<option value="Switzerland">Switzerland</option>
<option value="Syria">Syria</option>
<option value="Tahiti">Tahiti</option>
<option value="Taiwan">Taiwan</option>
<option value="Tajikistan">Tajikistan</option>
<option value="Tanzania">Tanzania</option>
<option value="Thailand">Thailand</option>
<option value="Togo">Togo</option>
<option value="Tokelau">Tokelau</option>
<option value="Tonga">Tonga</option>
<option value="Trinidad & Tobago">Trinidad & Tobago</option>
<option value="Tunisia">Tunisia</option>
<option value="Turkey">Turkey</option>
<option value="Turkmenistan">Turkmenistan</option>
<option value="Turks & Caicos Is">Turks & Caicos Is</option>
<option value="Tuvalu">Tuvalu</option>
<option value="Uganda">Uganda</option>
<option value="Ukraine">Ukraine</option>
<option value="United Arab Erimates">United Arab Emirates</option>
<option value="United Kingdom">United Kingdom</option>
<option value="United States of America">United States of America</option>
<option value="Uraguay">Uruguay</option>
<option value="Uzbekistan">Uzbekistan</option>
<option value="Vanuatu">Vanuatu</option>
<option value="Vatican City State">Vatican City State</option>
<option value="Venezuela">Venezuela</option>
<option value="Vietnam">Vietnam</option>
<option value="Virgin Islands (Brit)">Virgin Islands (Brit)</option>
<option value="Virgin Islands (USA)">Virgin Islands (USA)</option>
<option value="Wake Island">Wake Island</option>
<option value="Wallis & Futana Is">Wallis & Futana Is</option>
<option value="Yemen">Yemen</option>
<option value="Zaire">Zaire</option>
<option value="Zambia">Zambia</option>
<option value="Zimbabwe">Zimbabwe</option>
</select></td></tr>
<tr>
<th scope="row">Phone Number:</th>
<td><input class="input" type="text" name="phone_no" required /></td>
</tr>
</table>
<br />
<b>::::Next of kin::::</b>
<table style="background: #428bca;">
<tr>
<th scope="row">Full Name:</th>
<td><input class="input" type="text" name="n_fullname" required /></td>
</tr>
<tr>
<th scope="row">Country:</th>
<td><select name="n_country">
<option value="Afganistan">Afghanistan</option>
<option value="Albania">Albania</option>
<option value="Algeria">Algeria</option>
<option value="American Samoa">American Samoa</option>
<option value="Andorra">Andorra</option>
<option value="Angola">Angola</option>
<option value="Anguilla">Anguilla</option>
<option value="Antigua & Barbuda">Antigua & Barbuda</option>
<option value="Argentina">Argentina</option>
<option value="Armenia">Armenia</option>
<option value="Aruba">Aruba</option>
<option value="Australia">Australia</option>
<option value="Austria">Austria</option>
<option value="Azerbaijan">Azerbaijan</option>
<option value="Bahamas">Bahamas</option>
<option value="Bahrain">Bahrain</option>
<option value="Bangladesh">Bangladesh</option>
<option value="Barbados">Barbados</option>
<option value="Belarus">Belarus</option>
<option value="Belgium">Belgium</option>
<option value="Belize">Belize</option>
<option value="Benin">Benin</option>
<option value="Bermuda">Bermuda</option>
<option value="Bhutan">Bhutan</option>
<option value="Bolivia">Bolivia</option>
<option value="Bonaire">Bonaire</option>
<option value="Bosnia & Herzegovina">Bosnia & Herzegovina</option>
<option value="Botswana">Botswana</option>
<option value="Brazil">Brazil</option>
<option value="British Indian Ocean Ter">British Indian Ocean Ter</option>
<option value="Brunei">Brunei</option>
<option value="Bulgaria">Bulgaria</option>
<option value="Burkina Faso">Burkina Faso</option>
<option value="Burundi">Burundi</option>
<option value="Cambodia">Cambodia</option>
<option value="Cameroon">Cameroon</option>
<option value="Canada">Canada</option>
<option value="Canary Islands">Canary Islands</option>
<option value="Cape Verde">Cape Verde</option>
<option value="Cayman Islands">Cayman Islands</option>
<option value="Central African Republic">Central African Republic</option>
<option value="Chad">Chad</option>
<option value="Channel Islands">Channel Islands</option>
<option value="Chile">Chile</option>
<option value="China">China</option>
<option value="Christmas Island">Christmas Island</option>
<option value="Cocos Island">Cocos Island</option>
<option value="Colombia">Colombia</option>
<option value="Comoros">Comoros</option>
<option value="Congo">Congo</option>
<option value="Cook Islands">Cook Islands</option>
<option value="Costa Rica">Costa Rica</option>
<option value="Cote DIvoire">Cote D'Ivoire</option>
<option value="Croatia">Croatia</option>
<option value="Cuba">Cuba</option>
<option value="Curaco">Curacao</option>
<option value="Cyprus">Cyprus</option>
<option value="Czech Republic">Czech Republic</option>
<option value="Denmark">Denmark</option>
<option value="Djibouti">Djibouti</option>
<option value="Dominica">Dominica</option>
<option value="Dominican Republic">Dominican Republic</option>
<option value="East Timor">East Timor</option>
<option value="Ecuador">Ecuador</option>
<option value="Egypt">Egypt</option>
<option value="El Salvador">El Salvador</option>
<option value="Equatorial Guinea">Equatorial Guinea</option>
<option value="Eritrea">Eritrea</option>
<option value="Estonia">Estonia</option>
<option value="Ethiopia">Ethiopia</option>
<option value="Falkland Islands">Falkland Islands</option>
<option value="Faroe Islands">Faroe Islands</option>
<option value="Fiji">Fiji</option>
<option value="Finland">Finland</option>
<option value="France">France</option>
<option value="French Guiana">French Guiana</option>
<option value="French Polynesia">French Polynesia</option>
<option value="French Southern Ter">French Southern Ter</option>
<option value="Gabon">Gabon</option>
<option value="Gambia">Gambia</option>
<option value="Georgia">Georgia</option>
<option value="Germany">Germany</option>
<option value="Ghana">Ghana</option>
<option value="Gibraltar">Gibraltar</option>
<option value="Great Britain">Great Britain</option>
<option value="Greece">Greece</option>
<option value="Greenland">Greenland</option>
<option value="Grenada">Grenada</option>
<option value="Guadeloupe">Guadeloupe</option>
<option value="Guam">Guam</option>
<option value="Guatemala">Guatemala</option>
<option value="Guinea">Guinea</option>
<option value="Guyana">Guyana</option>
<option value="Haiti">Haiti</option>
<option value="Hawaii">Hawaii</option>
<option value="Honduras">Honduras</option>
<option value="Hong Kong">Hong Kong</option>
<option value="Hungary">Hungary</option>
<option value="Iceland">Iceland</option>
<option value="India">India</option>
<option value="Indonesia">Indonesia</option>
<option value="Iran">Iran</option>
<option value="Iraq">Iraq</option>
<option value="Ireland">Ireland</option>
<option value="Isle of Man">Isle of Man</option>
<option value="Israel">Israel</option>
<option value="Italy">Italy</option>
<option value="Jamaica">Jamaica</option>
<option value="Japan">Japan</option>
<option value="Jordan">Jordan</option>
<option value="Kazakhstan">Kazakhstan</option>
<option value="Kenya">Kenya</option>
<option value="Kiribati">Kiribati</option>
<option value="Korea North">Korea North</option>
<option value="Korea Sout">Korea South</option>
<option value="Kuwait">Kuwait</option>
<option value="Kyrgyzstan">Kyrgyzstan</option>
<option value="Laos">Laos</option>
<option value="Latvia">Latvia</option>
<option value="Lebanon">Lebanon</option>
<option value="Lesotho">Lesotho</option>
<option value="Liberia">Liberia</option>
<option value="Libya">Libya</option>
<option value="Liechtenstein">Liechtenstein</option>
<option value="Lithuania">Lithuania</option>
<option value="Luxembourg">Luxembourg</option>
<option value="Macau">Macau</option>
<option value="Macedonia">Macedonia</option>
<option value="Madagascar">Madagascar</option>
<option value="Malaysia">Malaysia</option>
<option value="Malawi">Malawi</option>
<option value="Maldives">Maldives</option>
<option value="Mali">Mali</option>
<option value="Malta">Malta</option>
<option value="Marshall Islands">Marshall Islands</option>
<option value="Martinique">Martinique</option>
<option value="Mauritania">Mauritania</option>
<option value="Mauritius">Mauritius</option>
<option value="Mayotte">Mayotte</option>
<option value="Mexico">Mexico</option>
<option value="Midway Islands">Midway Islands</option>
<option value="Moldova">Moldova</option>
<option value="Monaco">Monaco</option>
<option value="Mongolia">Mongolia</option>
<option value="Montserrat">Montserrat</option>
<option value="Morocco">Morocco</option>
<option value="Mozambique">Mozambique</option>
<option value="Myanmar">Myanmar</option>
<option value="Nambia">Nambia</option>
<option value="Nauru">Nauru</option>
<option value="Nepal">Nepal</option>
<option value="Netherland Antilles">Netherland Antilles</option>
<option value="Netherlands">Netherlands (Holland, Europe)</option>
<option value="Nevis">Nevis</option>
<option value="New Caledonia">New Caledonia</option>
<option value="New Zealand">New Zealand</option>
<option value="Nicaragua">Nicaragua</option>
<option value="Niger">Niger</option>
<option value="Nigeria">Nigeria</option>
<option value="Niue">Niue</option>
<option value="Norfolk Island">Norfolk Island</option>
<option value="Norway">Norway</option>
<option value="Oman">Oman</option>
<option value="Pakistan">Pakistan</option>
<option value="Palau Island">Palau Island</option>
<option value="Palestine">Palestine</option>
<option value="Panama">Panama</option>
<option value="Papua New Guinea">Papua New Guinea</option>
<option value="Paraguay">Paraguay</option>
<option value="Peru">Peru</option>
<option value="Phillipines">Philippines</option>
<option value="Pitcairn Island">Pitcairn Island</option>
<option value="Poland">Poland</option>
<option value="Portugal">Portugal</option>
<option value="Puerto Rico">Puerto Rico</option>
<option value="Qatar">Qatar</option>
<option value="Republic of Montenegro">Republic of Montenegro</option>
<option value="Republic of Serbia">Republic of Serbia</option>
<option value="Reunion">Reunion</option>
<option value="Romania">Romania</option>
<option value="Russia">Russia</option>
<option value="Rwanda">Rwanda</option>
<option value="St Barthelemy">St Barthelemy</option>
<option value="St Eustatius">St Eustatius</option>
<option value="St Helena">St Helena</option>
<option value="St Kitts-Nevis">St Kitts-Nevis</option>
<option value="St Lucia">St Lucia</option>
<option value="St Maarten">St Maarten</option>
<option value="St Pierre & Miquelon">St Pierre & Miquelon</option>
<option value="St Vincent & Grenadines">St Vincent & Grenadines</option>
<option value="Saipan">Saipan</option>
<option value="Samoa">Samoa</option>
<option value="Samoa American">Samoa American</option>
<option value="San Marino">San Marino</option>
<option value="Sao Tome & Principe">Sao Tome & Principe</option>
<option value="Saudi Arabia">Saudi Arabia</option>
<option value="Senegal">Senegal</option>
<option value="Serbia">Serbia</option>
<option value="Seychelles">Seychelles</option>
<option value="Sierra Leone">Sierra Leone</option>
<option value="Singapore">Singapore</option>
<option value="Slovakia">Slovakia</option>
<option value="Slovenia">Slovenia</option>
<option value="Solomon Islands">Solomon Islands</option>
<option value="Somalia">Somalia</option>
<option value="South Africa">South Africa</option>
<option value="Spain">Spain</option>
<option value="Sri Lanka">Sri Lanka</option>
<option value="Sudan">Sudan</option>
<option value="Suriname">Suriname</option>
<option value="Swaziland">Swaziland</option>
<option value="Sweden">Sweden</option>
<option value="Switzerland">Switzerland</option>
<option value="Syria">Syria</option>
<option value="Tahiti">Tahiti</option>
<option value="Taiwan">Taiwan</option>
<option value="Tajikistan">Tajikistan</option>
<option value="Tanzania">Tanzania</option>
<option value="Thailand">Thailand</option>
<option value="Togo">Togo</option>
<option value="Tokelau">Tokelau</option>
<option value="Tonga">Tonga</option>
<option value="Trinidad & Tobago">Trinidad & Tobago</option>
<option value="Tunisia">Tunisia</option>
<option value="Turkey">Turkey</option>
<option value="Turkmenistan">Turkmenistan</option>
<option value="Turks & Caicos Is">Turks & Caicos Is</option>
<option value="Tuvalu">Tuvalu</option>
<option value="Uganda">Uganda</option>
<option value="Ukraine">Ukraine</option>
<option value="United Arab Erimates">United Arab Emirates</option>
<option value="United Kingdom">United Kingdom</option>
<option value="United States of America">United States of America</option>
<option value="Uraguay">Uruguay</option>
<option value="Uzbekistan">Uzbekistan</option>
<option value="Vanuatu">Vanuatu</option>
<option value="Vatican City State">Vatican City State</option>
<option value="Venezuela">Venezuela</option>
<option value="Vietnam">Vietnam</option>
<option value="Virgin Islands (Brit)">Virgin Islands (Brit)</option>
<option value="Virgin Islands (USA)">Virgin Islands (USA)</option>
<option value="Wake Island">Wake Island</option>
<option value="Wallis & Futana Is">Wallis & Futana Is</option>
<option value="Yemen">Yemen</option>
<option value="Zaire">Zaire</option>
<option value="Zambia">Zambia</option>
<option value="Zimbabwe">Zimbabwe</option>
</select></td>
</tr>
<tr>
<th scope="row">Address:</th>
<td><input class="input" type="text" name="n_address" required /></td>
</tr>
<tr>
<th scope="row">Phone Number:</th>
<td><input class="input" type="text" name="n_phoneno" required /></td>
</tr>
<tr>
<th scope="row">Email:</th>
<td><input class="input" type="text" name="n_email" required /></td>
</tr>
<tr>
<th scope="row">Occupation:</th>
<td><input class="input" type="text" name="n_occupation" required /></td>
</tr>
</table>
<br>
<table>
<tr><td>
<input type="checkbox" name="checkbox1" id="checkbox1" required /> I have read and accept the terms and conditions</td></tr>
</table>
<input type="submit" name="submit" value="Register" />
</table>
</form>
<a href="index.php">Back to Login Page</a>
</div><!-- end .entry-content -->
</div><!-- end .postclass -->
</div><!-- end #content -->
<div id="sidebar" class="sidebar widget-area">
<div id="custom_post_widget-9" class="widget widget_custom_post_widget"></div>
<div id="custom_post_widget-10" class="widget widget_custom_post_widget"></div>
<div id="nav_menu-3" class="widget widget_nav_menu"></div>
</div>
</div><!-- end #content-sidebar-wrap -->
</div><!-- end .wrap --></div><!-- end #inner --><div id="footer-widgets" class="footer-widgets"><div class="wrap"><div class="footer-widgets-1 widget-area"><div id="custom_post_widget-7" class="widget widget_custom_post_widget"><div class="widget-wrap">
</div></div>
</div>
</div></div><!-- end .wrap --></div><!-- end #footer -->
</div><!-- end #wrap -->
</body></html>
<?php
//include header template
require('layout/footer.php');
?>
Sorry but you lost the formatting when you posted your code and it makes it almost imposible to read, you need to use the <> just above the comment box here. Press the <> and paste your code between the symbols that appear, do this for each time you press the <>.
Login and Registration system with PHP - DC Blog
This tutorial will cover creating a login system with registration upon registering an activation...
https://dcblog.dev/login-and-registration-system-with-php