-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtext.php
146 lines (103 loc) · 2.41 KB
/
text.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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
<!DOCTYPE html>
<html><head>
<meta http-equiv="refresh" content="0; url=bloggin.php"/>
</head>
<style>
.first {
width: 560px;
display: block;
margin: auto;
background-color: #A13736;
padding: 1em ;
color: white;
text-align: center;
margin-top: 1em;
font-family: "Lato";
font-size: 1.6em;
border-top-left-radius: 8px;
border-top-right-radius: 8px;
position: relative; }
.avatar {
width: 6%;
display: inline-block;
vertical-align: top;
position: relative;
overflow: hidden;
margin-left: 26%;
}
.avatar img {
width: 85%;
border-radius: 50%;
border: 5px solid #dcdcdc;
position: relative; }
.avatar:hover {
cursor: pointer;
}
.bubble {
width: 460px;
margin-left: 10px;
padding: .5em 1em;
line-height: 1.4em;
padding: 20px;
background-color: #dcdcdc;
position: relative;
border-radius: 8px;
text-align: left;
display: inline-block; }
h3 {
font-size: 1.2em;
font-weight: bold;
font-family: "corbel";
display: inline-block;
margin-bottom: .2em;
color: #95a5a6; }
body {
font-family: "Segoe UI Symbol";
color: #7f8c8d;
font-size: 14px;
background-color: #ededed; }
</style>
<body>
<?php
session_start();
$host="localhost";
$user="root";
$password="root@123";
$text=$_POST['postm'];
$name=$_SESSION["name"];
//$name=$_POST['suname'];
//setcookie("$name", "idf", time() + (86400 * 30), "/");
$con = mysqli_connect("$host","$user","$password");
if($con)
{
mysqli_select_db($con,"test");
$query="insert into textcontent(user,content,time) values ('$name','$text',now())";
$result=mysqli_query($con,$query);
$query="Select content from textcontent";
$result=mysqli_query($con,$query);
?>
<span class="first">
@
<?php //if(isset($_COOKIE[$name]))
// { echo "$name ";}
?>
</span>
<?php
while($row=mysqli_fetch_array($result))
{?>
<br>
<div class="avatar">
<img src="http://www.croop.cl/UI/twitter/images/doug.jpg">
</div>
<div class="bubble">
<h3>@<?php// echo "$name"?></h3>blogged<br/>
<?php echo "$row[0]"; ?>
</div>
<br><br>
<?php }mysqli_close($con); }
else
{
echo '<h1>MySQL Server is not connected</h1>';
} ?>
</body>
</html>