Demo-Email varification with randompassword
Hello Friends Ajj Me Apko Btaunga Ki Kis Prakar Ham Random Password Generator Signupform Bana Sakte Hai .Agar Aap New Hai Php Fresher Ho Or Apko Email Verification Script Bnanae Ke Liye Problem A Rhe Hai To Aap Is Script Ka Use Kar Sakte Ho.Starting Me .Is Code Me Apke Pass Ek Registration Form Hoga Janha Par User Signup Karega Apni Details Dalker Like Firstname,Lastname,Username,Dob,Phone Dalkar Agar Username(Emailid) Pehele Se He Hmare Database Me Store Hogi (Means Us Email Par Pehle Se Account Hoga) To User Ke Pass Signup Karne Ke Bad Message Show Hoga Ki “Email Id Already Exit And Use Different Email Id”
But Agar Email Id Pehle Se Already Exit Ne Hue To User Ki Details Hmare Database Me Store Ho Jayegi Or Sath He Ek Random Password Generate Hoga Jo User Ke Email Id Par Chala Jayega .(Full Login Detail Ke Sath).
How It Work- Yanha Ham Php Mailer Ka Use Karke User Login Details User Ke Email Id Par Send Karege To Isk Liye Aap Jarrur Phpmailer Liberary Download Kar Lijiye .
Hello Friends Ajj Me Apko Btaunga Ki Kis Prakar Ham Random Password Generator Signupform Bana Sakte Hai .Agar Aap New Hai Php Fresher Ho Or Apko Email Verification Script Bnanae Ke Liye Problem A Rhe Hai To Aap Is Script Ka Use Kar Sakte Ho.Starting Me .Is Code Me Apke Pass Ek Registration Form Hoga Janha Par User Signup Karega Apni Details Dalker Like Firstname,Lastname,Username,Dob,Phone Dalkar Agar Username(Emailid) Pehele Se He Hmare Database Me Store Hogi (Means Us Email Par Pehle Se Account Hoga) To User Ke Pass Signup Karne Ke Bad Message Show Hoga Ki “Email Id Already Exit And Use Different Email Id”
But Agar Email Id Pehle Se Already Exit Ne Hue To User Ki Details Hmare Database Me Store Ho Jayegi Or Sath He Ek Random Password Generate Hoga Jo User Ke Email Id Par Chala Jayega .(Full Login Detail Ke Sath).
How It Work- Yanha Ham Php Mailer Ka Use Karke User Login Details User Ke Email Id Par Send Karege To Isk Liye Aap Jarrur Phpmailer Liberary Download Kar Lijiye .
Mail420.php------------
<center>
<fieldset>
<form action="mail420.php" method="post">
<center><h1>Email Varification With Random Password Generator(signupform)</h1></center>
<br>
Email:<input type="text" size="50" name="username" placeholder="Enter Email Id"><br><br>
firstname:<input type="text" size="50" name="firstname" placeholder="firstname"><br><br>
lastname:<input type="text" size="50" name="lastname" placeholder="lastname"><br><br>
D.O.B:<input type="date" size="50" name="dob" placeholder="Enter dob"><br><br>
Phone:<input type="text" size="50" name="phone" placeholder="Enter Phone Number"><br><br>
<input type="submit" name="submit" value="submit"></center>
<center><a href="login.php"> <h3><b>Login</a><center>
</form>
</fieldset>
</center>
<?php
$con=mysqli_connect("localhost","root","","pdologin");
if(isset($_POST['submit'])){
$password=rand(1000,9000);
$username=$_POST["username"];
$firstname=$_POST["firstname"];
$lastname=$_POST["lastname"];
$dob=$_POST["dob"];
$phone=$_POST["phone"];
$query = "SELECT * FROM User WHERE username='$username'";
$res_u = mysqli_query($con, $query );
if (mysqli_num_rows($res_u) > 0) {
echo "email already exits";
}else{
$newpassoword = md5($password);
$query ="insert into User(username,password,firstname,lastname,dob,phone) values ('$username','$newpassoword','$firstname','$lastname','$dob','$phone')";
mysqli_query($con,$query)
?>
<br>
Plz check out your email id for Your Password
<br>
<?php
require 'PHPMailer-master/PHPMailerAutoload.php';
$mail = new PHPMailer();
//Enable SMTP debugging.
$mail->SMTPDebug = 0;
//Set PHPMailer to use SMTP.
$mail->isSMTP();
//Set SMTP host name
$mail->Host = "smtp.gmail.com";
$mail->SMTPOptions = array(
'ssl' => array(
'verify_peer' => false,
'verify_peer_name' => false,
'allow_self_signed' => true
)
);
//Set this to true if SMTP host requires authentication to send email
$mail->SMTPAuth = TRUE;
//Provide username and password
$mail->Username = "yourgmailid@gmail.com";
$mail->Password = "yourgmailpassword";
//If SMTP requires TLS encryption then set it
$mail->SMTPSecure = "false";
$mail->Port = 587;
//Set TCP port to connect to
$mail->From = "bhupenderkashyap122@gmail.com";
$mail->FromName = "gajabwap";
$mail->addAddress($_POST['username']);
$mail->isHTML(true);
$mail->Subject = $_POST['username'];
$mail->Body = "Your Username is " .$username. "& Password is " .$password. "<br>";
$mail->AltBody = "you can login now";
if(!$mail->send())
{
echo "Mailer Error: " . $mail->ErrorInfo;
}
else
{
echo "<h1>Message has been sent successfully</h1>";
}
}
}
?>
Ab aap pdologin name se ek database teyar kar lijiye or Wanha niche diye gye database code ko import kar Lijiye.
-- phpMyAdmin SQL Dump
-- version 4.7.0
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Jun 04, 2018 at 04:20 PM
-- Server version: 10.1.26-MariaDB
-- PHP Version: 7.1.8
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8mb4 */;
--
-- Database: `pdologin`
--
-- --------------------------------------------------------
--
-- Table structure for table `user`
--
CREATE TABLE `user` (
`id` int(10) NOT NULL,
`username` varchar(255) NOT NULL,
`password` varchar(255) NOT NULL,
`firstname` varchar(255) NOT NULL,
`lastname` varchar(255) NOT NULL,
`dob` date NOT NULL,
`phone` varchar(255) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data for table `user`
--
INSERT INTO `user` (`id`, `username`, `password`, `firstname`, `lastname`, `dob`, `phone`) VALUES
(26, 'bhupenderkashyap122@gmail.com', '16de63b2df373d5a9da881c8a1c58794', 'Bhupender', 'jjhhjhj', '2018-06-12', '8954782303');
--
-- Indexes for dumped tables
--
--
-- Indexes for table `user`
--
ALTER TABLE `user`
ADD PRIMARY KEY (`id`);
--
-- AUTO_INCREMENT for dumped tables
--
--
-- AUTO_INCREMENT for table `user`
--
ALTER TABLE `user`
MODIFY `id` int(10) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=27;COMMIT;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
App Yanha Hash_Password Ka Use Karke Ise Secure Bana Sakte Ho …Me Ummid Karta Hu Kip Hp Fresher Ke Liye Ye Script Helpful Hogi Agar Koi Problem A Rhe Hai ,Code Ko Run Karwane Me To Aap Comment Me Puch Sakte Ho Thank You
Team Gajabwap Web In Hindi
ConversionConversion EmoticonEmoticon