-
Notifications
You must be signed in to change notification settings - Fork 0
/
main3.php
71 lines (67 loc) · 1.59 KB
/
main3.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
<html>
<style>
footer {
position: fixed;
left: 0;
bottom: 0;
width: 100%;
background-color: black;
color: white;
text-align: center;
}
nav {
margin-left:0;
width:100%;
background-color: black;
font-family: sans-serif;
color : white;
font-size:130% ;
padding:5px;
}
</style>
<body>
<div style="border:5px solid black ;width:100%; height:100%;background-size:cover;background-image:url(main.jpg);background-size:full;background-repeat:no-repeat">
<center>
<div style="width:50%; height:70%;margin-top:300px;margin-left:60px">
<center>
<?php
Session_start();
include("connection1.php");
echo<<<vaga
<form method="post"><br>
<label style="margin-top:20px;font-family:Times New Roman;font-size:30px"><b>Enter Your Name:</b></label><br><br>
<input type="text" name="name" style="width:400px;height:50px;margin-top:20px;border:solid black" placeholder="Enter your username"><br><br>
<input type="submit" name="submit" style="font-family:algerian;font-size:30px;background-color:white;color:blue;border:solid black" value="Submit">
</form>
vaga;
if(isset($_POST['submit']))
{
$user_name=$_POST['name'];
if($user_name !="")
{
$_SESSION['user_name']=$user_name;
$q="INSERT INTO `user`(`name`) VALUES('".$user_name."')";
if(mysqli_query($con,$q))
{
echo "you are succesfully registered";
header('location:chatbox.php');
}
else
echo $q;
}
else
echo"Enter user name";
}
else
{
echo "Press the Button Above";
}
?>
</center>
</div>
</center>
</div>
</body>
<footer align="center">
</footer>
</html>