-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathcommonfeedphp.php
76 lines (61 loc) · 1.63 KB
/
commonfeedphp.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
<?php
session_start();
?>
<?php
include 'dbconnect.php'
?>
<?php
if(!$_SESSION['login']){
header("location:http://192.168.121.187:8001/anjali/index.html");
}
$thepost="";
$username="";
$username=$_SESSION["username"];
//echo "723";
//echo $_SESSION["username"];
//echo $username;
//echo "uwe";
if($_SERVER['REQUEST_METHOD'] === 'POST')
{
//echo "hsji";
$getId="select id from anjali_signup where username='$username'";
$query3=mysqli_query($con,$getId);
$id=mysqli_fetch_assoc($query3);
$value=$id['id'];
$thepost=htmlspecialchars($_POST["userpost"]);
$feedpost="update anjali_posts a,anjali_signup b
set post='$thepost'
where username='$username'
and a.id=b.id and post is NULL";
$createid="insert into anjali_posts(id)
values
($value)";
$query4=mysqli_query($con,$createid);
$setdate="update anjali_signup
set fdate=curdate()
where username='$username'";
$settime="update anjali_signup set ftime=curtime() where username='$username'";
$query=mysqli_query($con,$feedpost);
$query3=mysqli_query($con,$setdate);
$query2=mysqli_query($con,$settime);
//echo $query;
}
$seepost="select anjali_posts.post,anjali_signup.name,anjali_signup.ftime,anjali_signup.fdate from anjali_posts,anjali_signup where anjali_signup.id=anjali_posts.id and anjali_posts.post is not NULL";
$query1=mysqli_query($con,$seepost);
//echo $query1;
//echo "<div>";
while($see=mysqli_fetch_array($query1))
{
echo "<br>";
echo "<div>";
echo $see['post'];
echo "</div>";
echo $see['name'];
echo "<br>";
echo $see['ftime'];
echo "<br>";
echo $see['fdate'];
echo "<br>";
}
//echo "</div>";
?>