How to Generate Random Password with PHP and MySQL

How to Generate Random Password with PHP and MySQL

Password is always be at the most risk because if your password is not strong then someone can steal your account and access all your details.Your password should have to be strong to prevent account stealing so it will be tougher to crack your password. So, in this tutorial we will show you how to generate strong random password using PHP and MySQL

Password is always be at the most risk because if your password is not strong then someone can steal your account and access all your details.Your password should have to be strong to prevent account stealing so it will be tougher to crack your password. So, in this tutorial we will show you how to generate strong random password using PHP and MySQL

To Generate Random Password It Takes Only three Steps:-

Step 1: Make a HTML file and define markup and scripting

We make a HTML file and save it with a name random_password.html

<html>
<head>
<link type="text/css" rel="stylesheet" href="random_password_style.css"/>
</head>
<body>
<div id="wrapper">

<div id="signup_form">
<p id="signup_label">Random Password Generator</p>
<form method="post"action="generate_password.php">
 <input type="text" name="name" id="name" placeholder="Enter Name">
 <br>
 <input type="text" name="email" placeholder="Enter Email">
 <br>
 <input type="submit" name="signup" value="DO SIGNUP">
</form>
</div>

</div>
</body>
</html>

In this step we create a form to enter details by user and send it to 'generate_password.php' file to generate password and do signup.Always validate data before form submitting you can view our form validation using jquery tutorial to see how to validate data.

Step 2: Make a PHP file to generate random password and do signup

We make a PHP file and save it with a name generate_password.php

// Database Structure 
CREATE TABLE `users` (
 `id` int(11) NOT NULL AUTO_INCREMENT,
 `name` text NOT NULL,
 `email` text NOT NULL,
 `password` text NOT NULL,
 PRIMARY KEY (`id`)
) ENGINE=MyISAM AUTO_INCREMENT=5 DEFAULT CHARSET=latin1

<?php
if(isset($_POST['signup']))
{
 $host="localhost";
 $username="root";
 $password="";
 $databasename="sample";
 $connect=mysql_connect($host,$username,$password);
 $db=mysql_select_db($databasename);

 $name=$_POST['name'];
 $email=$_POST['email'];
 $chars = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";
 $password = substr( str_shuffle( $chars ), 0, 8 );
 mysql_query("insert into users values('','$name','$email','$password')");
 echo "Your Password Is : ".$password;
}
?>

In this step we create a database table called 'users' to store user details and then get name and email entered by user and then generate random password by writting alphanumeric string and using str_shuffle() function to get strong and random password and after that we store all the details in table and display the password to user you can also send email to user email id having password in email message instead of displaying in form.

Step 3: Make a CSS file and define styling

We make a CSS file and save it with a name random_password_style.css

body
{
 margin:0 auto;
 padding:0px;
 text-align:center;
 width:100%;
 font-family: "Myriad Pro","Helvetica Neue",Helvetica,Arial,Sans-Serif;
 background-color:#9FA3C9;
}
#wrapper
{
 margin:0 auto;
 padding:0px;
 text-align:center;
 width:995px;
}
#wrapper h1
{
 margin-top:50px;
 font-size:45px;
 color:#4C3866;
}
#wrapper h1 p
{
 font-size:18px;
}
#signup_form
{
 background-color:white;
 width:270px;
 margin-left:345px;
 box-shadow:0px 0px 15px 0px #4C3866;
 padding:15px;
}
#signup_form #signup_label
{
 color:#4C3866;
 margin:0px;
 padding-bottom:10px;
 margin-bottom:30px;
 font-size:25px;
 border-bottom:1px solid #E6E6E6;
}
#signup_form input[type="text"]
{
 width:230px;
 height:35px;
 padding-left:10px;
 font-size:16px;
 margin-bottom:15px;
 border:1px solid #D8D8D8;
 color:#585858;
}
#signup_form input[type="submit"]
{
 width:230px;
 margin-left:-4px;
 height:40px;
 font-size:16px;
 font-weight:bold;
 background-color:#775E9B;
 color:white;
 border:none;
 border-bottom:5px solid #4C3866;
 border-radius:3px;
}

That's all, this is how to generate random and strong password using PHP and MySQL.You can customize this code further as per your requirement. And please feel free to give comments on this tutorial.

Thạn you so much !

Build a Register & Login Form using PHP, HTML, CSS, Bootstrap and MySQL

Build a Register & Login Form using PHP, HTML, CSS, Bootstrap and MySQL

In this tutorial you will learn and build a Responsive PHP Registration & Login Form using PHP, HTML, CSS, Bootstrap and MySQL

Welcome to this video on Responsive PHP User Login and Registration Form with PHP and MySQL From Scratch. In this course you will Learn and build a Responsive PHP Registration & Login Form using PHP, HTML, CSS, Bootstrap and MySQL. After watching this course you will be able to Create your own registration form connected to the MySQL database. In this course will explain step by step from scratch how to build a login system that you can customize it. The course covers all the aspects of HTML, CSS, JavaScript, PHP, MySQL along with Bootstrap Framework to create a real-time registration form. Making a Super Simple Registration System With PHP and MySQL will be easy ans step by step process.

All Code of this video can be found here: https://github.com/pknowledge/useraccounts
https://github.com/pknowledge/userlogin

PhP MySQL Projects

PhP MySQL Projects

Simpliv LLC, a platform for learning and teaching online courses. We basically focus on online learning which helps to learn business concepts, software technology to develop personal and professional goals through video library by recognized industry experts and trainers.

Description
PHP Projects in Urdu is a comprehensive course. It has five PHP projects in Urdu. Each project is created from scratch. You will get source code of each project as well. The list of 5 projects is as under:

Project 1: Find and Replace Application
Project 2: Building an Email Marketing Application
Project 3: Creating a Contact Form
Project 4: Building a Search Engine For Database
Project 5: Building a PHP Quiz Application
As this is an intermediate level course so it has some requisites as well

This is a Urdu/Hindi video course

Who this Course is for:

Anyone who wants to learn Web development
Who wants to become a PHP Developer
Basic knowledge
You must have basic knowledge about PHP and Mysql
You must be able to write HTML and CSS as well
What will you learn
How to Find and Replace Application
How to Build an Email Marketing Application
How to Create a Contact Form
How to Build a Search Engine For Database
How to Build a PHP Quiz Application
To continue:

The Complete PHP MySQL Professional Course with 5 Projects

The Complete PHP MySQL Professional Course with 5 Projects

The Complete PHP MySQL Professional Course with 5 Projects

Description
Have you ever wonder why their are so many PHP Mysql Courses but they offer very little practical skills. Sometimes its difficult for beginners to understand the long project right after learning basics due to lack of practice.Furthermore, big courses just give presentation to projects they never ever let students see their actual content. For example the basic videos, Free starter content etc. However this course is Scam-Free course. Students can watch more than 2 hour of initial content free of cost to decide weather to buy this course or not.

This course is designed in more logical way from easy to complex modules step by step. Here is description of the course

Road Map:

Building Blocks Fundamentals 5 Hour 30 mints of Content

Projects:

Regular Expressions 25 mints
Complete Contact Form + Email 1 Hour of Content
Dynamic Web Pages (Directory Project) 1 Hour of Content
CMS Based Employee Management CRUD 2 Hour + 30 minutes of Content
CMS + Admin Panel with Stunning blog + FREE Bootstrap 4.2.1 12 Hour of Content
This course will focus on all the Fundamentals , Building blocks and Advance Concepts of PHP in complete details which are essentials for beginners. In this Course students will build project after every section to see the real world representation of PHP.

Bonuses:

Getting Started with Bootstrap 4 FrameWork from scratch without using any Bootstrap Template
Latest Bootstrap 4.2.1 Essentials Practically in a Project
Using PHP Sessions in a more sophisticated way and pass information easily on different modules of Project
Full Coding Exercises
Login Logout Admin System
Tips / Tricks
Code Re-usability
Strong Security Techniques on Public Pages
PDO layer for Database Operations
Enhancing UI UX in admin Panel so that the Admin can manage the different Components of CMS / Blog easily
Enhancing UI UX in Public Panel so that the Public / Users can easily interact with the different Functionalities of Blog easily.
Using PHP Sessions in a more sophisticated way and pass information easily on different modules of Project
Login Logout Admin System
URL Tracking
Font Awesome
PHP 5.6 and 7 Supports
Admin Info Update
Now if you want to learn PHP and start your professional career, Take this course now

This course is for complete beginners and for those who want to build projects in PHP.

Who this course is for:

Complete Beginners
PHP Aspirants
Designers who want to Start Back-End Programming
College Students
Basic knowledge
No Knowledge required of PHP. This course will teach students everything about PHP from Scratch
Basic HTML
PC of-course :)
What will you learn
All PHP Fundamentals and Building Blocks with practical implementation in Projects
Form Validation with most Secure way using Regular Expressions
Making web pages dynamic with the variety of PHP Techniques
Employee Management System CRUD Application in PHP From Scartch
Complete CMS ( Content Management System) with Admin-Panel
Getting Started with Bootstrap 4 FrameWork from scratch without using any Bootstrap Template
Using PHP Sessions in a more sophisticated way and pass information easily on different modules of Project
Stunning Blog with Commenting functionality
Powerful Web Forms which will be Free of Hack
Build Professional CRUD
CMS Based Projects
Full Coding Exercises
Login Logout Admin System
Tips / Tricks
Sending Email using PHP
Bootstrap 4.2.1
PDO
URL Tracking
Security Techniques on Public pages
Font Awsome
To continue: