{"id":1349,"date":"2022-11-28T09:03:33","date_gmt":"2022-11-28T01:03:33","guid":{"rendered":"https:\/\/hostscripter.com\/?p=1349"},"modified":"2022-11-28T09:03:33","modified_gmt":"2022-11-28T01:03:33","slug":"part-4-create-your-own-registration-system-using-php-and-mysql","status":"publish","type":"post","link":"https:\/\/hostscripter.com\/?p=1349","title":{"rendered":"Part 4: Create your own Registration System using PHP and MySql"},"content":{"rendered":"<h2 id=\"registeringuserswithphpmysql\">4. Registering Users with PHP &amp; MySQL<\/h2>\n<p>Now we need to create the registration file that will process the form fields, check for basic validation, and insert the new account into our database.<\/p>\n<p>The registration page will require a connection to our database and therefore we must include the necessary variables and MySQL functions. Edit the\u00a0<i>register.php<\/i>\u00a0file and add the following code:<\/p>\n<div class=\"code-header\"><\/div>\n<pre class=\" language-php\"><code class=\" language-php\"><span class=\"token php language-php\"><span class=\"token delimiter important\">&lt;?php<\/span>\r\n<span class=\"token comment\">\/\/ Change this to your connection info.<\/span>\r\n<span class=\"token variable\">$DATABASE_HOST<\/span> <span class=\"token operator\">=<\/span> <span class=\"token string\">'localhost'<\/span><span class=\"token punctuation\">;<\/span>\r\n<span class=\"token variable\">$DATABASE_USER<\/span> <span class=\"token operator\">=<\/span> <span class=\"token string\">'root'<\/span><span class=\"token punctuation\">;<\/span>\r\n<span class=\"token variable\">$DATABASE_PASS<\/span> <span class=\"token operator\">=<\/span> <span class=\"token string\">''<\/span><span class=\"token punctuation\">;<\/span>\r\n<span class=\"token variable\">$DATABASE_NAME<\/span> <span class=\"token operator\">=<\/span> <span class=\"token string\">'phplogin'<\/span><span class=\"token punctuation\">;<\/span>\r\n<span class=\"token comment\">\/\/ Try and connect using the info above.<\/span>\r\n<span class=\"token variable\">$con<\/span> <span class=\"token operator\">=<\/span> <span class=\"token function\">mysqli_connect<\/span><span class=\"token punctuation\">(<\/span><span class=\"token variable\">$DATABASE_HOST<\/span><span class=\"token punctuation\">,<\/span> <span class=\"token variable\">$DATABASE_USER<\/span><span class=\"token punctuation\">,<\/span> <span class=\"token variable\">$DATABASE_PASS<\/span><span class=\"token punctuation\">,<\/span> <span class=\"token variable\">$DATABASE_NAME<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span>\r\n<span class=\"token keyword\">if<\/span> <span class=\"token punctuation\">(<\/span><span class=\"token function\">mysqli_connect_errno<\/span><span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">)<\/span> <span class=\"token punctuation\">{<\/span>\r\n\t<span class=\"token comment\">\/\/ If there is an error with the connection, stop the script and display the error.<\/span>\r\n\t<span class=\"token function\">exit<\/span><span class=\"token punctuation\">(<\/span><span class=\"token string\">'Failed to connect to MySQL: '<\/span> <span class=\"token punctuation\">.<\/span> <span class=\"token function\">mysqli_connect_error<\/span><span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span>\r\n<span class=\"token punctuation\">}<\/span><\/span><\/code><\/pre>\n<p>Don&#8217;t forget to update the MySQL variables if your MySQL credentials do not reflect the declared values.<\/p>\n<p>Next, we can add basic validation to ensure the user has entered their details and check for empty variables.<\/p>\n<div class=\"code-header\"><\/div>\n<pre class=\" language-php\"><code class=\" language-php\"><span class=\"token comment\">\/\/ Now we check if the data was submitted, isset() function will check if the data exists.<\/span>\r\n<span class=\"token keyword\">if<\/span> <span class=\"token punctuation\">(<\/span><span class=\"token operator\">!<\/span><span class=\"token function\">isset<\/span><span class=\"token punctuation\">(<\/span><span class=\"token global\">$_POST<\/span><span class=\"token punctuation\">[<\/span><span class=\"token string\">'username'<\/span><span class=\"token punctuation\">]<\/span><span class=\"token punctuation\">,<\/span> <span class=\"token global\">$_POST<\/span><span class=\"token punctuation\">[<\/span><span class=\"token string\">'password'<\/span><span class=\"token punctuation\">]<\/span><span class=\"token punctuation\">,<\/span> <span class=\"token global\">$_POST<\/span><span class=\"token punctuation\">[<\/span><span class=\"token string\">'email'<\/span><span class=\"token punctuation\">]<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">)<\/span> <span class=\"token punctuation\">{<\/span>\r\n\t<span class=\"token comment\">\/\/ Could not get the data that should have been sent.<\/span>\r\n\t<span class=\"token function\">exit<\/span><span class=\"token punctuation\">(<\/span><span class=\"token string\">'Please complete the registration form!'<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span>\r\n<span class=\"token punctuation\">}<\/span>\r\n<span class=\"token comment\">\/\/ Make sure the submitted registration values are not empty.<\/span>\r\n<span class=\"token keyword\">if<\/span> <span class=\"token punctuation\">(<\/span><span class=\"token function\">empty<\/span><span class=\"token punctuation\">(<\/span><span class=\"token global\">$_POST<\/span><span class=\"token punctuation\">[<\/span><span class=\"token string\">'username'<\/span><span class=\"token punctuation\">]<\/span><span class=\"token punctuation\">)<\/span> <span class=\"token operator\">||<\/span> <span class=\"token function\">empty<\/span><span class=\"token punctuation\">(<\/span><span class=\"token global\">$_POST<\/span><span class=\"token punctuation\">[<\/span><span class=\"token string\">'password'<\/span><span class=\"token punctuation\">]<\/span><span class=\"token punctuation\">)<\/span> <span class=\"token operator\">||<\/span> <span class=\"token function\">empty<\/span><span class=\"token punctuation\">(<\/span><span class=\"token global\">$_POST<\/span><span class=\"token punctuation\">[<\/span><span class=\"token string\">'email'<\/span><span class=\"token punctuation\">]<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">)<\/span> <span class=\"token punctuation\">{<\/span>\r\n\t<span class=\"token comment\">\/\/ One or more values are empty.<\/span>\r\n\t<span class=\"token function\">exit<\/span><span class=\"token punctuation\">(<\/span><span class=\"token string\">'Please complete the registration form'<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span>\r\n<span class=\"token punctuation\">}<\/span><\/code><\/pre>\n<p>Now we need to check if the account already exists in the database. We can check this by selecting a record from our accounts table with the same\u00a0<i class=\"hl\">username<\/i>\u00a0that the user has provided.<\/p>\n<p>Add after:<\/p>\n<div class=\"code-header\"><\/div>\n<pre class=\" language-php\"><code class=\" language-php\"><span class=\"token comment\">\/\/ We need to check if the account with that username exists.<\/span>\r\n<span class=\"token keyword\">if<\/span> <span class=\"token punctuation\">(<\/span><span class=\"token variable\">$stmt<\/span> <span class=\"token operator\">=<\/span> <span class=\"token variable\">$con<\/span><span class=\"token operator\">-<\/span><span class=\"token operator\">&gt;<\/span><span class=\"token function\">prepare<\/span><span class=\"token punctuation\">(<\/span><span class=\"token string\">'SELECT id, password FROM accounts WHERE username = ?'<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">)<\/span> <span class=\"token punctuation\">{<\/span>\r\n\t<span class=\"token comment\">\/\/ Bind parameters (s = string, i = int, b = blob, etc), hash the password using the PHP password_hash function.<\/span>\r\n\t<span class=\"token variable\">$stmt<\/span><span class=\"token operator\">-<\/span><span class=\"token operator\">&gt;<\/span><span class=\"token function\">bind_param<\/span><span class=\"token punctuation\">(<\/span><span class=\"token string\">'s'<\/span><span class=\"token punctuation\">,<\/span> <span class=\"token global\">$_POST<\/span><span class=\"token punctuation\">[<\/span><span class=\"token string\">'username'<\/span><span class=\"token punctuation\">]<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span>\r\n\t<span class=\"token variable\">$stmt<\/span><span class=\"token operator\">-<\/span><span class=\"token operator\">&gt;<\/span><span class=\"token function\">execute<\/span><span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span>\r\n\t<span class=\"token variable\">$stmt<\/span><span class=\"token operator\">-<\/span><span class=\"token operator\">&gt;<\/span><span class=\"token function\">store_result<\/span><span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span>\r\n\t<span class=\"token comment\">\/\/ Store the result so we can check if the account exists in the database.<\/span>\r\n\t<span class=\"token keyword\">if<\/span> <span class=\"token punctuation\">(<\/span><span class=\"token variable\">$stmt<\/span><span class=\"token operator\">-<\/span><span class=\"token operator\">&gt;<\/span><span class=\"token property\">num_rows<\/span> <span class=\"token operator\">&gt;<\/span> <span class=\"token number\">0<\/span><span class=\"token punctuation\">)<\/span> <span class=\"token punctuation\">{<\/span>\r\n\t\t<span class=\"token comment\">\/\/ Username already exists<\/span>\r\n\t\t<span class=\"token keyword\">echo<\/span> <span class=\"token string\">'Username exists, please choose another!'<\/span><span class=\"token punctuation\">;<\/span>\r\n\t<span class=\"token punctuation\">}<\/span> <span class=\"token keyword\">else<\/span> <span class=\"token punctuation\">{<\/span>\r\n\t\t<span class=\"token comment\">\/\/ Insert new account<\/span>\r\n\t<span class=\"token punctuation\">}<\/span>\r\n\t<span class=\"token variable\">$stmt<\/span><span class=\"token operator\">-<\/span><span class=\"token operator\">&gt;<\/span><span class=\"token function\">close<\/span><span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span>\r\n<span class=\"token punctuation\">}<\/span> <span class=\"token keyword\">else<\/span> <span class=\"token punctuation\">{<\/span>\r\n\t<span class=\"token comment\">\/\/ Something is wrong with the sql statement, check to make sure accounts table exists with all 3 fields.<\/span>\r\n\t<span class=\"token keyword\">echo<\/span> <span class=\"token string\">'Could not prepare statement!'<\/span><span class=\"token punctuation\">;<\/span>\r\n<span class=\"token punctuation\">}<\/span>\r\n<span class=\"token variable\">$con<\/span><span class=\"token operator\">-<\/span><span class=\"token operator\">&gt;<\/span><span class=\"token function\">close<\/span><span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span>\r\n<span class=\"token delimiter important\">?&gt;<\/span><\/code><\/pre>\n<p>Replace:<\/p>\n<pre class=\" language-php\"><code class=\" language-php\"><span class=\"token comment\">\/\/ Insert new account<\/span><\/code><\/pre>\n<p>With:<\/p>\n<div class=\"code-header\"><\/div>\n<pre class=\" language-php\"><code class=\" language-php\"><span class=\"token comment\">\/\/ Username doesnt exists, insert new account<\/span>\r\n<span class=\"token keyword\">if<\/span> <span class=\"token punctuation\">(<\/span><span class=\"token variable\">$stmt<\/span> <span class=\"token operator\">=<\/span> <span class=\"token variable\">$con<\/span><span class=\"token operator\">-<\/span><span class=\"token operator\">&gt;<\/span><span class=\"token function\">prepare<\/span><span class=\"token punctuation\">(<\/span><span class=\"token string\">'INSERT INTO accounts (username, password, email) VALUES (?, ?, ?)'<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">)<\/span> <span class=\"token punctuation\">{<\/span>\r\n\t<span class=\"token comment\">\/\/ We do not want to expose passwords in our database, so hash the password and use password_verify when a user logs in.<\/span>\r\n\t<span class=\"token variable\">$password<\/span> <span class=\"token operator\">=<\/span> <span class=\"token function\">password_hash<\/span><span class=\"token punctuation\">(<\/span><span class=\"token global\">$_POST<\/span><span class=\"token punctuation\">[<\/span><span class=\"token string\">'password'<\/span><span class=\"token punctuation\">]<\/span><span class=\"token punctuation\">,<\/span> <span class=\"token constant\">PASSWORD_DEFAULT<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span>\r\n\t<span class=\"token variable\">$stmt<\/span><span class=\"token operator\">-<\/span><span class=\"token operator\">&gt;<\/span><span class=\"token function\">bind_param<\/span><span class=\"token punctuation\">(<\/span><span class=\"token string\">'sss'<\/span><span class=\"token punctuation\">,<\/span> <span class=\"token global\">$_POST<\/span><span class=\"token punctuation\">[<\/span><span class=\"token string\">'username'<\/span><span class=\"token punctuation\">]<\/span><span class=\"token punctuation\">,<\/span> <span class=\"token variable\">$password<\/span><span class=\"token punctuation\">,<\/span> <span class=\"token global\">$_POST<\/span><span class=\"token punctuation\">[<\/span><span class=\"token string\">'email'<\/span><span class=\"token punctuation\">]<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span>\r\n\t<span class=\"token variable\">$stmt<\/span><span class=\"token operator\">-<\/span><span class=\"token operator\">&gt;<\/span><span class=\"token function\">execute<\/span><span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span>\r\n\t<span class=\"token keyword\">echo<\/span> <span class=\"token string\">'You have successfully registered, you can now login!'<\/span><span class=\"token punctuation\">;<\/span>\r\n<span class=\"token punctuation\">}<\/span> <span class=\"token keyword\">else<\/span> <span class=\"token punctuation\">{<\/span>\r\n\t<span class=\"token comment\">\/\/ Something is wrong with the sql statement, check to make sure accounts table exists with all 3 fields.<\/span>\r\n\t<span class=\"token keyword\">echo<\/span> <span class=\"token string\">'Could not prepare statement!'<\/span><span class=\"token punctuation\">;<\/span>\r\n<span class=\"token punctuation\">}<\/span><\/code><\/pre>\n<p>This will insert a new account into our accounts table.<\/p>\n<p>Remember in our\u00a0<a class=\"l1\" href=\"https:\/\/codeshack.io\/secure-login-system-php-mysql\/\" target=\"_blank\" rel=\"noopener noreferrer\">Login System<\/a>\u00a0we used the\u00a0<i class=\"hl\"><a class=\"l1\" href=\"https:\/\/php.net\/manual\/en\/function.password-verify.php\" target=\"_blank\" rel=\"noopener noreferrer\">password_verify<\/a><\/i>\u00a0function? As you can see in the code above we use the\u00a0<i class=\"hl\"><a class=\"l1\" href=\"https:\/\/php.net\/manual\/en\/function.password-hash.php\" target=\"_blank\" rel=\"noopener noreferrer\">password_hash<\/a><\/i>\u00a0function, this will encrypt the user&#8217;s password using the one-way algorithm \u2014 this will prevent your users passwords from being exposed if for somehow your database becomes vulnerable.<\/p>\n<p>That&#8217;s basically all we need to do to register accounts on our website.<\/p>\n<div data-counters='false' data-style='square' data-size='small' data-url='https:\/\/hostscripter.com\/?p=1349' data-title='Part 4: Create your own Registration System using PHP and MySql' class='linksalpha_container linksalpha_app_3'><a href='\/\/www.linksalpha.com\/share?network='facebook' class='linksalpha_icon_facebook'><\/a><a href='\/\/www.linksalpha.com\/share?network='twitter' class='linksalpha_icon_twitter'><\/a><a href='\/\/www.linksalpha.com\/share?network='googleplus' class='linksalpha_icon_googleplus'><\/a><a href='\/\/www.linksalpha.com\/share?network='mail' class='linksalpha_icon_mail'><\/a><\/div><div data-position='' data-url='https:\/\/hostscripter.com\/?p=1349' data-title='Part 4: Create your own Registration System using PHP and MySql' class='linksalpha_container linksalpha_app_7'><a href='\/\/www.linksalpha.com\/share?network='facebook' class='linksalpha_icon_facebook'><\/a><a href='\/\/www.linksalpha.com\/share?network='twitter' class='linksalpha_icon_twitter'><\/a><a href='\/\/www.linksalpha.com\/share?network='googleplus' class='linksalpha_icon_googleplus'><\/a><a href='\/\/www.linksalpha.com\/share?network='mail' class='linksalpha_icon_mail'><\/a><\/div>","protected":false},"excerpt":{"rendered":"<p>4. Registering Users with PHP &amp; MySQL Now we need to create the registration file that will process the form fields, check for basic validation, and insert the new account [&hellip;]<\/p>\n","protected":false},"author":301,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_newsletter_tier_id":0,"footnotes":""},"categories":[4],"tags":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p9KaPo-lL","jetpack_likes_enabled":true,"jetpack-related-posts":[{"id":1343,"url":"https:\/\/hostscripter.com\/?p=1343","url_meta":{"origin":1349,"position":0},"title":"Part 1: Create your own Registration System using PHP and MySql","author":"h05t5cr1pt3r","date":"November 28, 2022","format":false,"excerpt":"This tutorial is a follow up to our previous tutorial\u00a0Secure Login System with PHP and MySQL. In this tutorial, we'll be creating a secure registration form and implementing basic validation. A registration form is what your website's visitors can use to register their details, which will subsequently be stored in\u2026","rel":"","context":"In &quot;Blog&quot;","block_context":{"text":"Blog","link":"https:\/\/hostscripter.com\/?cat=4"},"img":{"alt_text":"Secure Registration System with PHP and MySQL","src":"https:\/\/i0.wp.com\/codeshack.io\/web\/img\/posts\/secure-registration-system-php-mysql.png?resize=350%2C200&ssl=1","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/codeshack.io\/web\/img\/posts\/secure-registration-system-php-mysql.png?resize=350%2C200&ssl=1 1x, https:\/\/i0.wp.com\/codeshack.io\/web\/img\/posts\/secure-registration-system-php-mysql.png?resize=525%2C300&ssl=1 1.5x, https:\/\/i0.wp.com\/codeshack.io\/web\/img\/posts\/secure-registration-system-php-mysql.png?resize=700%2C400&ssl=1 2x"},"classes":[]},{"id":1354,"url":"https:\/\/hostscripter.com\/?p=1354","url_meta":{"origin":1349,"position":1},"title":"Part 6: Create your own Registration System using PHP and MySql","author":"h05t5cr1pt3r","date":"November 28, 2022","format":false,"excerpt":"6. Implementing Account Activation The account activation system will send an email to the user with the activation link when the user has registered. The first thing we need to do is to go into\u00a0phpMyAdmin\u00a0and select our database, in our case this would be\u00a0phplogin, you can either add the column\u00a0activation_code\u00a0to\u2026","rel":"","context":"In &quot;Blog&quot;","block_context":{"text":"Blog","link":"https:\/\/hostscripter.com\/?cat=4"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":1341,"url":"https:\/\/hostscripter.com\/?p=1341","url_meta":{"origin":1349,"position":2},"title":"Part 7: Create your own Login System using PHP and MySql","author":"h05t5cr1pt3r","date":"November 28, 2022","format":false,"excerpt":"7. Creating the Logout Script Creating the logout script is straightforward. All you need to do is destroy the sessions that were declared in the authenticate file. Edit the\u00a0logout.php\u00a0file and add the following code: <?php session_start(); session_destroy(); \/\/ Redirect to the login page: header('Location: index.html'); ?> Initialize sessions, destroy them,\u2026","rel":"","context":"In &quot;Blog&quot;","block_context":{"text":"Blog","link":"https:\/\/hostscripter.com\/?cat=4"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":1335,"url":"https:\/\/hostscripter.com\/?p=1335","url_meta":{"origin":1349,"position":3},"title":"Part 4: Create your own Login System using PHP and MySql","author":"h05t5cr1pt3r","date":"November 28, 2022","format":false,"excerpt":"4. Authenticating Users with PHP Now that we have our database setup, we can go ahead and start coding with PHP. We're going to start with the authentication file, which will process and validate the form data that we'll send from our\u00a0index.html\u00a0file. Edit the\u00a0authenticate.php\u00a0file and add the following: <?php session_start();\u2026","rel":"","context":"In &quot;Blog&quot;","block_context":{"text":"Blog","link":"https:\/\/hostscripter.com\/?cat=4"},"img":{"alt_text":"Authentication Incorrect Username PHP","src":"https:\/\/i0.wp.com\/codeshack.io\/web\/img\/phplogin\/authentication-incorrect-username.png?resize=350%2C200&ssl=1","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/codeshack.io\/web\/img\/phplogin\/authentication-incorrect-username.png?resize=350%2C200&ssl=1 1x, https:\/\/i0.wp.com\/codeshack.io\/web\/img\/phplogin\/authentication-incorrect-username.png?resize=525%2C300&ssl=1 1.5x, https:\/\/i0.wp.com\/codeshack.io\/web\/img\/phplogin\/authentication-incorrect-username.png?resize=700%2C400&ssl=1 2x"},"classes":[]},{"id":1347,"url":"https:\/\/hostscripter.com\/?p=1347","url_meta":{"origin":1349,"position":4},"title":"Part 3: Create your own Registration System using PHP and MySql","author":"h05t5cr1pt3r","date":"November 28, 2022","format":false,"excerpt":"3. Creating the Database and setting-up Tables You can skip this step if you followed the\u00a0Secure Login System Tutorial. For this part, you will need to access your MySQL database, either using\u00a0phpMyAdmin\u00a0or your preferred MySQL database management application. If you're using\u00a0phpMyAdmin\u00a0then follow these instructions: Navigate to:\u00a0http:\/\/localhost\/phpmyadmin\/ Click the\u00a0Databases\u00a0tab at the\u2026","rel":"","context":"In &quot;Blog&quot;","block_context":{"text":"Blog","link":"https:\/\/hostscripter.com\/?cat=4"},"img":{"alt_text":"phpMyAdmin Accounts Table","src":"https:\/\/i0.wp.com\/codeshack.io\/web\/img\/phplogin\/phpmyadmin-accounts-table.png?resize=350%2C200&ssl=1","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/codeshack.io\/web\/img\/phplogin\/phpmyadmin-accounts-table.png?resize=350%2C200&ssl=1 1x, https:\/\/i0.wp.com\/codeshack.io\/web\/img\/phplogin\/phpmyadmin-accounts-table.png?resize=525%2C300&ssl=1 1.5x, https:\/\/i0.wp.com\/codeshack.io\/web\/img\/phplogin\/phpmyadmin-accounts-table.png?resize=700%2C400&ssl=1 2x"},"classes":[]},{"id":1329,"url":"https:\/\/hostscripter.com\/?p=1329","url_meta":{"origin":1349,"position":5},"title":"Part 1: Create your own Login System using PHP and MySql","author":"h05t5cr1pt3r","date":"November 28, 2022","format":false,"excerpt":"In this tutorial, I'll be teaching you how you can create your very own secure PHP login system. A login form is what your website's visitors can use to log in to your website to access restricted content, such as a profile page. We will leverage MySQL to retrieve account\u2026","rel":"","context":"In &quot;Blog&quot;","block_context":{"text":"Blog","link":"https:\/\/hostscripter.com\/?cat=4"},"img":{"alt_text":"Secure Login System with PHP and MySQL","src":"https:\/\/i0.wp.com\/codeshack.io\/web\/img\/posts\/secure-login-system-php-mysql.png?resize=350%2C200&ssl=1","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/codeshack.io\/web\/img\/posts\/secure-login-system-php-mysql.png?resize=350%2C200&ssl=1 1x, https:\/\/i0.wp.com\/codeshack.io\/web\/img\/posts\/secure-login-system-php-mysql.png?resize=525%2C300&ssl=1 1.5x, https:\/\/i0.wp.com\/codeshack.io\/web\/img\/posts\/secure-login-system-php-mysql.png?resize=700%2C400&ssl=1 2x"},"classes":[]}],"_links":{"self":[{"href":"https:\/\/hostscripter.com\/index.php?rest_route=\/wp\/v2\/posts\/1349"}],"collection":[{"href":"https:\/\/hostscripter.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/hostscripter.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/hostscripter.com\/index.php?rest_route=\/wp\/v2\/users\/301"}],"replies":[{"embeddable":true,"href":"https:\/\/hostscripter.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1349"}],"version-history":[{"count":2,"href":"https:\/\/hostscripter.com\/index.php?rest_route=\/wp\/v2\/posts\/1349\/revisions"}],"predecessor-version":[{"id":1351,"href":"https:\/\/hostscripter.com\/index.php?rest_route=\/wp\/v2\/posts\/1349\/revisions\/1351"}],"wp:attachment":[{"href":"https:\/\/hostscripter.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1349"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/hostscripter.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1349"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/hostscripter.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1349"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}