Join For Complete Training in PHP,ANDROID,DIGITAL MARKETING (+91 8149996597)
Thursday, 16 June 2022
Php Mailer
step 1:-
download phpmailer library file form https://github.com/PHPMailer/PHPMailer
step 2:- signupform.html code :-
<html>
<head>
</head>
<body>
<form action="register.php" method="post">
<label> First name </label>
<input type="text" name="firstname">
<label> Last name </label>
<input type="text" name="lastname">
<label> Contact no </label>
<input type="text" name="contactno">
<label> Email </label>
<input type="text" name="email">
<labe> Password</label>
<input type="text" name="password">
<label> Confirm Password </label>
<input type="text" name="confirmpassword">
<input type="submit" name="send" value="signup">
</form>
</body>
</html>
</html>
step 3:- write register.php file code.
<?php
include ("connect.php");
use PHPMailer\PHPMailer\PHPMailer;
use PHPMailer\PHPMailer\SMTP;
use PHPMailer\PHPMailer\Exception;
$firstname=$_POST['firstname'];
$lastname=$_POST['lastname'];
$contactno=$_POST['contactno'];
$email=$_POST['email'];
$password=$_POST['password'];
$v_code=bin2hex(random_bytes(16));
function sendmail($email,$v_code)
{
require "PHPMailer\PHPMailer.php";
require "PHPMailer\SMTP.php";
require "PHPMailer\Exception.php";
$mail = new PHPMailer(true);
try {
$mail->isSMTP(); //Send using SMTP
$mail->Host = 'smtp.gmail.com'; //Set the SMTP server to send through
$mail->SMTPAuth = true; //Enable SMTP authentication
$mail->Username = 'yourgmailid@gmail.com'; //SMTP username
$mail->Password = 'yourgmailpassword'; //SMTP password
$mail->SMTPSecure = PHPMailer::ENCRYPTION_SMTPS; //Enable implicit TLS encryption
$mail->Port = 465; //TCP port to connect to; use 587 if you have set `SMTPSecure = PHPMailer::ENCRYPTION_STARTTLS`
//Recipients
$mail->setFrom('yourgmailid@gmail.com', 'Musaib');
$mail->addAddress($email); //Add a recipient
//Content
$mail->isHTML(true); //Set email format to HTML
$mail->Subject = 'Email Verification from Musaib';
$mail->Body = "Thanks for Registration!
Click the link below to verify the email address
<a href='http://localhost:8081/emailverify/verify.php?email=$$email&v_code=$v_code'>Verify </a>";
$mail->send();
return true; //mail sent
}
catch (Exception $e) {
return false; //mail not sent
}
}
$sql="insert into user (firstname,lastname,contactno,email,password,v_code,is_verified) values('$firstname','$lastname','$contactno','$email','$password','$v_code')";
$result=mysqli_query($con,$sql);
if($result&&sendmail($_POST['email'],$v_code))
{
echo "<script>
alert ('Registration Succesfully');
window.location.href='signupform.html';
</script>";
}
else
{
echo "<script>
alert ('Registration Failed');
</script>";
}
?>
step 4:- verify.php file code:-
<?php
include("connect.php");
$email=$_GET['email'];
$v_code=$_GET['v_code'];
if(isset($_GET['email')&& isset($_GET['v_code']))
{
$sql="select from user where email='$email' And v_code='$v_code'";
$result=mysqli_query($con,$sql);
$num=mysqli_num_rows($result);
if($num>0)
{
$result_fetch=mysqli_fetch_array($result);
if($result_fetch['is_verified']==0)
{
$sql="update user set is_verified='1' where email='$result_fetch'";
if(mysqli_query($con,$sql)
{
echo "<script>
alert("email verification succesful");
</script>";
}
else{
echo "<script>
alert("email verification failed");
</script>";
}
}
}
else
{
echo "<script>
alert("email already registered");
</script>";// not executed
}
}
?>
Friday, 10 June 2022
PHP Email verification Code example
(1)first create table user:
create table user
(id int primary key auto_increment,
name varchar(200),
email varchar(200),
phone varchar(200),
password varchar(200),
com_code varchar(200));
(2)write code for connect.php file:
<?php
$con=mysqli_connect("localhost","root","","database");
?>
(3)write code for registerform.php file:
<?php
echo '<form action="insert1.php" method="post">
Name<input type=text name="name">
Email<input type=email name="email">
phone <input type=text name="phone">
password<input type=password name="password">
<input type=submit name=submit value=submit>';
?>
(4)write code for insert1.php file:
<?php
$name=$_POST['name'];
$email=$_POST['email'];
$phone=$_POST['phone'];
$password=$_POST['password'];
$com_code=md5(uniqid(rand()));
include_once("connect.php");
$sql="insert into user(name,email,phone,password,com_code)values('$name','$email','$phone','$password','$com_code')";
$result=mysqli_query($con,$sql) ;
if($result)
{
$to = $email;
$subject = "Confirmation from Musaib to $username";
$header = "Musaibwebsite: Confirmation LInk";
$message .= "http://musaib.com/confirm.php?passkey=$com_code";
$sentmail = mail($to,$subject,$message,$header);
if($sentmail)
{
echo "Your Confirmation link Has Been Sent To Your Email Address.";
}
else
{
echo "Cannot send Confirmation link to your e-mail address";
}
}
?>
<?php
include_once("connect.php");
$passkey = $_GET['passkey'];
$sql="update user set com_code='1' where com_code='$passkey'";
$result=mysqli_query($con,$sql) ;
if($result)
{
echo "your account is active ";
}
?>
Blockchain Development Training in Free with Certification
Are you want to start career in most globally demanded course Blockchain Development Training in Free with Certification click here for free sign up
Thursday, 9 June 2022
Python Basic Syllabus
- Python Introduction
- Python Syntax
- Python Comments
- Python Variables
- Python Data Types
- Python Numbers
- Python Casting
- Python Strings
- Python Booleans
- Python Operators
- Python Lists
- Python Tuples
- Python Sets
- Python Dictionaries
- Python If...Else
- Python While Loops
- Python For Loops
- Python Functions
- Python Lambda
- Python Arrays
Software Programming Certification:-
We Provide professional certificate courses
designed to acquire expertise in programming languages :- C,
C++, JAVA, Python, Html,Css,Javascrip,Jquery , PHP & mysql
Software Programmer are in high demand due to
the rapid growth of the Information & Technology sector in India. These
courses focus on the Programming Languages and Design and Development of
multiple software.
What does a Software Programmer Do ?
The Prime
responsibilities of Software Developer is as follows:
- Designing
and Creating Software: The main
responsibility in a software development job is to develop functional
software after performing extensive research on the specific requirements
of the user.
- Evaluating
Both New and Existing Software:
Software developers run tests on the softwares to ensure it is completely
functional and free from bugs after coding and encrypting. They have to
perform quality assurance (QA) tests and diagnostic programs on newly
designed software prior to their launch as well as the existing projects
so as to test their efficacy and reliability quotient.
- Enhancing
Existing Software Systems:
Software developer’s job is to monitor user feedback and suggestions and
incorporate those suggestions into the existing software infrastructure to
continually improve it. Software developers must be able to identify the
core functionality of software programs and enhance its performance and
security level.
- Maintenance
Of Existing Systems: Software
developers have to continually monitor and maintain the efficacy of both
the new and existing software systems by running QA tests from time to
time. Software developers have to find solutions to the problems arising
and eliminate them in due time.
- Collaborating
With Other Teams: Software developer’s have to
collaborate with other developers in his/her team like project managers,
computer programmers, graphic designers, and database administrators. They
have to regularly consult with clients and project managers to learn about
the progress of their software projects.
Wednesday, 11 May 2022
Object Oriented Principles of Java(OOPs) in Hindi
Object Oriented Principles of Java(OOPs)
java के बारे में आप पहले बताया जा चूका है की java एक object oriented programming language होता है java भी सभी object oriented programming language की तरह object oriented principles को follow करती है
इन principles के बारे में निचे दिया जा रहा है
Encapsulation
encapsulation को डाटा hiding भी कहते है encapsulation में आप प्राइवेट variable declare करते है और आओ उन्हें पब्लिक methods के द्वारा (through) एक्सेस करते है आपके variable को आपकी ही क्लास के methods access कर सकते है
जिससे दूसरी कोई भी class आपके variable को access नही कर सकती है इस प्रकार आप डाटा को hide भी किया जा सकता है और प्रयोग भी किया जा सकता है
java में 3 level(लेवल) की डाटा hiding को provide करती है
- Public-इस level की सहायता से आप पब्लिक(public) class members को दूसरी कोई भी classes access कर सकती है
- Private-यह दूसरा level है जिसकी सहायता से आप प्राइवेट(private) class members को दूसरी कोई भी class access नही कर सकती है
- Protected-यह java का तीसरा level है जिसकी सहायता से आप केवल आपकी class को inherit करने वाली class ही आपके class members को access कर सकता है
Inheritance
inheritance की सहायता से आप एक class के variable को आप दूसरी class के variable को access कर सकते है ऐसा करने से आपको एक जैसा method(code) को बार बार लिखने की आवश्यकता नही होती है जिससे कंप्यूटर की मेमोरी और समय दोनों बचता है
java में multiple inheritance allow नहीं होता है क्योकि इसमे एक class सिर्फ एक ही class को inherit कर सकता है
इसलिए inheritance की “multiple inheritance allow नहीं” की कमी को java interfaces के through पूरा करता है
Polymorphism
polymorphism का मतलब है एक name और कई काम polymorphism के through आप एक interface से situation के according अलग अलग action ले सकते है
जैसे की आप इसे method ओवरलोडिंग(overloading) में किया जाता है
Abstraction
abstraction java का एक बहुत ही महत्वपूर्ण कांसेप्ट(important concept) होता है जैसे की जब आप bike को चलाते है पर आपको यह मालूम नही होता है की bike कैसे काम करती है केवल आप उसे बस चलाते है उसी internal working के बारे में आपको पता नही होता है उसी प्रकार abstraction का भी same concept है आप अपने सॉफ्टवेर की internal working user को शो (show) नहीं करते है बस user को वो interface provide करते है जिससे की वो interact करेगा
java data types in Hindi-जावा डाटा टाइप क्या है?
सामान्यत: data आपके पास कई प्रकार से available हो सकता है जैसे की किसी व्यक्ति का नाम उसका उम्र आदि
data अलग अलग तरह के होते है कभी data को संख्या में होता है तो शब्दों को होता है इसीलिए java में data को अलग अलग category में रखा गया है कोई भी वेरिएबल(variable) create करने से पहले आप उसमे किस तरह का data को स्टोर करना चाहिए define करना पड़ता है इसे ही data टाइप(Data type in java in Hindi) कहते है
java में data types(Data type in java in Hindi) को दो प्रकार से किया गया है
1.Primitive Data Type
2.Non-primitive Data Type
Primitive Data Type
Integers
integers complete नंबर होता है जो numbers में fractional पार्ट (दशमलव और उसके बाद की संख्या ) include नहीं किया जाता है java में integer data types को उसकी साइज़ के according 4 categories में define किया जाता है
Type Explanation Example
| Byte | Byte की साइज़ 8 बिट की होती है -127 से लेकर 128 तक की कोई भी वैल्यू(value) आप byte में स्टोर कर सकते है | byte age=40; |
| Short | short की साइज़ 16 बिट होती है short में -32768 से लेकर 68 से लेकर 32767 तक का कोई भी value स्टोर की जा सकती है | short salary=25000; |
| Int | int की साइज़ 32 बिट की होती है int में -214748364 B से लेकर 2147483747 तक की कोई भी value स्टोर की जा सकती है | int population =2,00,000 |
| long | long की साइज़ 64 बिट की होती है इसकी वैल्यू 9223372036854775808(-263) से 9223372036854775807 (263-1) तक होता है इसमे आप बड़ी से बड़ी value को स्टोर कर सकते है तथा इसमे ध्यान देना चाहिए की इसकी वैल्यू को L से end करना होता है | long my number=80000000L |
Floating point numbers
floating point numbers वो numbers होते है जिनमे fractional part (दशमलव और उसके बाद सख्या) को represent किया जाता है
जैसे जब आप कोई important mathematical कैलकुलेशन कर रहे हो तो इन numbers का बहुत महत्त्व रहता है java में floating point data types को 2 categories में define किया गया है
| Type | Explanation | Example |
| Float | float single precision value को represent करता है float की साइज़ 32 बिट होती है float में 1.4e-045 से लेकर 3.4e+038 तक की value स्टोर की जा सकती है float में दशमलव के बाद केवल एक value represent की जाती है | float temp=34.4; |
| Double | double double precision value को represent करता है double की साइज़ 64 बिट होती है double में 4.9e – 324 से लेकर 1.8e +308 तक की value स्टोर की जा सकती है double में दशमलव के बाद 7 value तक स्टोर की जा सकती है | double pi=3.1416 |
Character
किसी एक अक्षर को स्टोर करने के लिए आप character का प्रयोग करते है java में character data type की साइज़ 16 बिट की होती है character को char keyword से represent किया जाता है
char furlong =”c”
Boolean
java में boolean data type को logical decision स्टोर करने के लिए प्रयोग किया जाता है boolean variable की वैल्यू 2 तरह की होती है
true या false
boolean is five more than one =”true”
Non-primitive Data Type
जावा में non- primitive डाटा टाइप ऑब्जेक्ट(object) को refer करते है ये निम्नलिखित प्रकार के होते है –
Interface-class की तरह ही interface में भी मेथोड्स और वेरिएबल होते है जिसमे इसके declare की गयी मेथड abstract होते है
class-class किसी यूजर के द्वारा डिफाइन किया गया photo type होता है जिससे objects बनाये जाते है तथा इसमे मेथोड्स और वेरिएबल होते है
स्ट्रिंग(string)-string का प्रयोग characters के एक क्रम(sequence) को store करने के लिए किया जाता है तथा इसकी वैल्यू के डबल(double) quote के अन्दर लिखा जाता है
for example:- string myname=”school”
array-array एक समान डाटा टाइप एक कलेक्शन(collection) होता है
Introduction to java operators
जैसा की आप सब जानते है operators का उपयोग आप variables पर operations perform करने के लिए करते है। हर data type पर अलग अलग operations perform किये जाते है। इसलिए operators भी अलग अलग यूज़ होते है।
Operators unary और binary 2 प्रकार के होते है। Operators के साथ यूज़ होने वाले variables को operand कहते है। Unary operators एक operand के साथ apply होते है और binary operators 2 operands पर apply होते है।
Java में मुख्यतः 6 type के operators होते है।
- Arithmetic operators
- Logical operators
- Bit wise operators
- Relational operators
- Assignment operators
- Conditional operators
इन सभी operators आपको निचे दिया जा रहा है।
Arithmetic operators
Arithmetic operators mathematical computation perform करने के लिए यूज़ किये जाते है। Arithmetic operators 5 type के होते है। इनके बारे में निचे दिया जा रहा है।
Addition (+) Addition operator 2 values को add करने के लिए यूज़ किया जाता है। a+b Subtraction (-) Subtraction operator एक value में से दूसरी value को subtract
करने के लिए यूज़ किया जाता है। a-c Multiplication(*) Multiplication operators 2 variables की values
को multiply करने के लिए यूज़ किया जाता है। a*b Division(/) किसी एक variable की संख्या का भाग दूसरे
variable की संख्या में देने के लिए division operator यूज़ किया जाता है। a/b Modulus(%) भाग देने के बाद यदि आप शेष बची हुई संख्या प्राप्त करना चाहते है
तो modulus operator यूज़ करते है। a%b
करने के लिए यूज़ किया जाता है।
को multiply करने के लिए यूज़ किया जाता है।
variable की संख्या में देने के लिए division operator यूज़ किया जाता है।
तो modulus operator यूज़ करते है।
Logical operators
Logical operators boolean values पर operations perform करने के लिए यूज़ किये जाते है। ये operators 3 तरह के होते है। इस तरह के operations में दोनों variables की value true या false हो सकती है। Logical operators के बारे में निचे दिया जा रहा है।
Operator | Explanation | Example |
| Logical AND (&&) | इस तरह के operators के साथ जब दोनों variables की value true होती है तो ही result true होता है नहीं तो यह false हो जाता है | a&&b |
| Logical OR (||) | इस तरह के operator के साथ यदि दोनों variables में से किसी एक भी value true होगी तो result true ही होगा। | a||b |
| Logical NOT (!) | ये एक unary operator है। जिस भी variable के साथ ये यूज़ किया जाता है उस variable की value को उल्टा कर देता है। | !a |
Bit-wise operators
Bit-wise operators bit by bit operations perform करने के लिए यूज़ किये जाते है। ये operators variables की values को bits में convert करके उन पर operations perform करते है।Bit wise operators 4 तरह के होते है । जिनके बारे में आपको निचे दिया जा रहा है।
Operator | Explanation | Example |
| Bit wise AND (&) | इस operator को जिन 2 variables के साथ यूज़ किया जाता है ये उनकी common bits को result variable में copy कर देता है। | a&b |
| Bit wise OR (|) | इस operator को जिन 2 variables के साथ यूज़ किया जाता है ये उनकी uncommon bits को result variable में copy कर देता है। | a|b |
| Left shift (<<) | इस operator के द्वारा आप किसी variable की value को bits में convert करने के बाद उसकी bits को left में shift करते है। कितनी bits को शिफ्ट करना है ये वो variable बताता है जो इसके right में होता है। | a<<b |
| Right shift (>>) | इस variable के द्वारा आप किसी variable की value को bits में convert करने के बाद उसकी values को right में shift करते है। कितनी bits को shift करना है ये वो variable बताता है जो इसके right में होता है। | a>>b |
Relational operators
Relational operators 2 variables के बीच में relation को पता लगाने के लिए यूज़ किये जाते है। इनका प्रयोग ज्यादातर if statement में किया जाता है। इन operators से आपको 2 variables के बीच में relation का पता लगता है जैसे की क्या दोनों variables बराबर है या एक छोटा और एक बड़ा है।
Operator | Explanation | Example |
| Equal to (==) | यदि दोनों variables equal होते है तो result true होता है। | a==b |
| Not equal to(!=) | यदि दोनों variables एक दूसरे के equal नहीं होता है तो result true return होता है। | a!=b |
| Greater than(>) | यदि left side का variable right side के variable से बड़ा है तो result true होता है। | a>b |
| Less than(<) | यदि left side का variable right side के variable से छोटा है तो result true होता है। | a<b |
| Greater than equal to (>=) | यदि left side का variable right side के variable से बड़ा है या उसके बराबर है तो result true होगा। | a>=b |
| Less than equal to (<=) | यदि left side का variable right side के variable से छोटा है या उसके बराबर है तो result true होता है | a<=b |
Assignment operators
Assignment process को simple और fast बनाने के लिए java कुछ assignment operators provide करती है। इनके बारे में निचे दिया जा रहा है।
Operator | Explanation | Example |
| Simple assignment (=) | ये operator right value की value left variable को assign करता है। | a=b; |
| Plus assignment (+=) | ये operator left और right variables की value को add करके left variable में store करता है। | a+=b; |
| Minus assignment(-=) | ये operator left side के variable की value में से right side के variable की value घटाकर result left side के variable में store करता है। | a-=b |
| Multiply assignment(*=) | ये operator left और right side के variables की values को multiply करके result left side के variable में store करता है। | a*=b |
| Divide assignment(/=) | ये operator left side के variable की value को right side के variable से divide करके result left side के variable में store करता है। | a/=b |
Conditional operator (?:)
Conditional operator java का special operator होता है जो if statement की तरह काम करता है। इसे ternary operator भी कहते है। ये variables में conditions के according values store करने के लिए यूज़ किया जाता है। इस operator में ? से पहले एक condition दी जाती है , यदि वो condition true है तो colon से पहले वाली value नहीं तो colon के बाद वाली value variable में store होती है।
Example
a=5, b=3;
c= a>b?a:b; // c में a की value store की जाएगी।
| a%b |