Sign in

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 14

Signin.

php

<?php

session_start(); include("re.php");

if($_SERVER['REQUEST_METHOD'] == "POST")

$firstname = $_POST['fname'];

$lastname = $_POST['lname'];

$Gender = $_POST['gender'];

$num = $_POST['cnum'];

$address = $_POST['address'];

$gmail = $_POST['email']; $password = $_POST['pass'];

if(!empty($gmail) && !empty($password) && !is_numeric($gmail))

$query = "insert into form(fname,lname,gender,cnum,address,email,pass)


values('$firstname','$lastname','$Gender','$num','$address','$gmail','$password')";
mysqli_query($con,$query); echo "<script type='text/javascript'>
alert('Successfully Register')</script>";

else

echo "<script type='text/javascript'> alert('Please Enter some Valid Information')</script>";

?>

<!DOCTYPE html>

<html>

<head>

<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">

<title>Form Login and Register</title>

<link rel="stylesheet" href="design.css">

</head>

<body>

<div class="signup">

<h1>Sign Up</h1>

<h4>It's free and only takes a minute</h4>

<form method="POST">

<label>First Name</label>

<input type="text" name="fname" required>

<label>Last Name</label>

<input type="text" name="lname" required>

<label>Gender</label>

<input type="text" name="gender" required>

<label>Contact Address</label>

<input type="tel" name="cnum" required>

<label>Address</label>

<input type="text" name="address" required>

<label>Email</label>

<input type="email" name="email" required>

<label>Password</label>

<input type="password" name="pass" required>

<input type="submit" name="" value="Submit">

</form>

<p>By clicking the Sign Up button, you agree to our<br>

<a href="">Terms and Condition</a> and <a href="#">Policy Privacy</a></p>

<p>Already have an account? <a href="log.php">Login Here</a></p>

</div>

</body>

</html>
Log.php

<?php

session_start(); include("re.php");

if($_SERVER['REQUEST_METHOD'] == "POST")

$gmail = $_POST['email']; $password = $_POST['pass'];

if(!empty($gmail) && !empty($password) && !is_numeric($gmail))

$query = "select * from form where email = '$gmail' limit 1";

$result = mysqli_query($con, $query);

if($result){

if($result && mysqli_num_rows($result) > 0)

$user_data = mysqli_fetch_assoc($result);

if($user_data['pass'] == $password)

include("in.php");

die;

echo "<script type='text/javascript'> alert('Wrong username and password')</script>";

else{

echo "<script type='text/javascript'> alert('Wrong username and password')</script>";

?>
<!DOCTYPE html>

<html>

<head>

<meta charset="utf-8">

<meta name="viewport" content="width=device-width, initial-scale=1">

<title>Form Login and Register</title>

<link rel="stylesheet" href="design.css">

</head>

<body>

<div class="log">

<h1>Login</h1>

<form method="POST">

<label>Email</label>

<input type="email" name="email" required>

<label>Password</label>

<input type="password" name="pass" required>

<input type="submit" name="" value="Submit">

</form>

<p>Not have an accoount?<a href="signup.php">Sign Up here</a></p>

</div>

</body>

</html>

Re.php

<?php

$con = mysqli_connect("localhost", "root", "", "register") or die(mysqli_connect_error()); ?>

?>
In.php

<?php

include("re.php");

?>

<!DOCTYPE html>

<html>

<head>

<meta charset="utf-8">

<meta name="viewport" content="width=device-width, initial-scale=1">

<title>Form Login and Register</title>

<link rel="stylesheet" href="design.css">

</head>

<body>

<h1>Welcome User</h1>

<p><a href="log.php">Log Out</a></p>

</body>

</html>

Design.css

body{

background:

url(background.jpg);

width: 100%;

height: 100vh;

font-family: sans-serif;

}
.signup{

width: 360px;

height: 800px;

margin: auto;

background:white;

border-radius: 3px;

text-align: center;

.log{

width: 360px;

height: 340px;

margin: auto;

background:white;

border-radius: 3px;

text-align: center;

input[type="submit"]:hover{

color:white;

background: rgb(13,211,247);

input[type="submit"]{

width: 320px;

height: 35px;

margin-top: 20px;

border: none;

background-color: #ff7200;

color: white;

font-size: 18px;

cursor:pointer;

}
h1{

text-align: center;

p{

text-align:centre;

padding-top: 20px;

font-size: 15px;

h4{

text-align: center;

padding-top: 15px;

form{

width: 300px;

margin-left: 20px;

form input {

width: 100%;

padding: 7px;

border: none;

border: 1px solid gray;

border-radius: 6px;

outline: none;

form label{

display: flex;

margin-top: 20px;

font-size: 18px;

}
X

Triggers
Tracking

Operations
Privileges
iporugijgrigkry
arhan@143
com
Ialaiala@gmail

12345 12345
pass

com adtyagmail.com
com
Nono aryun@gmal aryangmail None

Sort
koy
by email Sort
key.
by
-Import
Export
uurungubud 9309710684
aurangabad
aurangabad
address9309710684
alitidsjtk Export vew
BCeate

9309710584 9309710684
tabin Search
tabie
this
Chum Doloto
|[Refresh]
this bookmark
Soarch chart
Display
Search
Insert
4
gender
form male
male
pesthuttwut
malo
malo
péshattwar thes
localhost/phprnyadmin/indexphp?route=/sql&pos=0&db=register&table=form
code Copy
tows peshattiwar access
Tsblo ) PHP
soconds Fltor
localhost/127.0.0.1/registet/t
x pathan Iname
user
SaLJ[Crealte
Export every
0002 Edt
rogistor
fname
aryuifaizanadityaaryan v Let
0 25
v
SQL took 25 O
Datshac inhne}[Edit][Explain
Quory 1 2 3 4 selecled
With
clipboad
lo
Copy
rows: ld rows.
OEdit
opy
DeleteDalctoOEdit
O
Copy
OEdit
Copy Copy
Delete
Delctodit
query
Structuretotal, of of
Numbar Number operations
Query
resuits
0-3(4 sQL
01 form
SELECT
FROM
127.0n Chedk
all this
rows |Edit Bookmark Con
his
SC
x all all
Search SorverBrowse Showing Profiling Show opüions
Extra
Show
Prnt
D
-localhost/phpmyodrmin O O Label
U

phpMyAdmin
information_schema
performance_schema
Q
O Favorites phpmyadmin
NeW
register
New +h
mysql
est
tHU
Recent
t +
our
to PrivaCy Lonnlere
minute agree
Sign
Up a youPalicy
takes button
ad ccount
Submt
onty chetanagrawai@
gmallcom aIdnden
Up
an
and Contact
Address Sign have
free the Already
Flrst
Name Last
Name |9309710684|Burangabad Password lema
clicking
AddresS
|BgrawalGender
It's
chetan male Emall
By

Set
default
as

browser
localhost/signup.php
O

default

Register your
isn't
and
Chrome
Login

Form Google
X
1412-
08-02

D
9
C
ENG
IN

Successuily
Register
says
localhost

Search

localhost/signup-php

localhos/sgnup-php

O
Triggers

Tracking

A
3
iponugikigrfigkry
Operations arhan143
123456
pass12345 12345

chetanagrawal@ymail.com

Privileges Ialalala@gmail.com
aditya@gmail.com
com com
Nono uryunidgmal aryangmail None
1
Sort
key
by emall Sort
key.
by
lImport
aurangabad
uurangubud aurangabad
uutungubud
address9309710684
alijfldsjtk Export view
Create
Search
Export
nsert D6849309710684
9309710084 9309710084
tabio 930971 table
cnum Delete bookrna
Relresh] this
this
Soarch Search chart
Display
gender
]| male malo male
peshattwar malo fmale
peshatwar this
form
rogitorblo:
localhost/phpmyadminindex code
php?route-/sql&pos=0&db=register&table=form Copy access
rows: poshattiwar rows:
seconds) PHP agrawal Filter
localhost/127.0.0.1/regstet/
x Filtor Iname pathan user
Create
0006 Edt
Export every
4 SQLJ| ¼
fname 4Docta5chetan
ld aryanfazanadtyaaryanDeiete
25
v Let
0 25
v
sQL took O
127001
-Sover
DatahC: Edt][Explain 1
Quary 2 3 selected
With
lo
cipboard
Copy
rows: DoctoDelete
opyeele rows
queny
structuretotal, of of
(5 ][ Numbar Number Query
operations
results sOL
0-4 SELECT
fors
FROM inhne Copy OEdt
Copy OEditCopy
OEditCopy
Check
alt this
n rows Edit
x al Bookmark
all
-Search Browse
Showing [Profing Show
Edra
oploi Odit
OEdit Show
ootons Prnt Con
O O
localthost/phpmyadmin ahal
O a

phpMyAdmin
tH pertormance_schene
H
information_schama
Q
O Favontes
Recent phpmyadmin
Newfom
register
New mysql

+
Uphere

Login accoount7Sign
Submit
@omail.
chatanagrawal
com

an
have
Password
Not
Email

locallhost/log,
Ophp
X

Register

and
Login

Form
1412-

D
49

ENG
IN

password

and
localhost
says username

Wrong
Search
Q

O
localhost/og.php

Olocalbost/Wog-php

16C
Hare
1412

D
49

ENG
IN

Welcome
User

Searcth
Q

O
localhost/log,
php

egister

and
Login news
PBrea
caug
Get
up
Form
Out
Log

You might also like