-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrepost.php
30 lines (29 loc) · 928 Bytes
/
repost.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
<?php
if(!isset($_COOKIE['user']) || !isset($_COOKIE['email'])){
header('Location:index.php');
}else{
?>
<?php
if(isset($_POST['repost'])){
require 'db.php';
$username=$_POST['realowner'];
$sharer=$_POST['reposter'];
$content=$_POST['content'];
$unique_id=$_POST['unique_id'];
$image=$_POST['image'];
$day=$_POST['day'];
$audio=$_POST['audio'];
$status='shared';
$unique_id=$_POST['unique_id'];
$sql="INSERT INTO user_post(username,caption,image,post_day,audio,status,sharer,unique_id) VALUES
('$username','$content','$image','$day','$audio','$status','$sharer','$unique_id')";
$result=mysqli_query($conn,$sql);
$sql2="INSERT INTO notifications(sender,details,owner,status,day,location,unique_id) VALUES('$sharer','$sharer shared your song','$username',0,'$day','shared','$sharer');";
$result2=mysqli_query($conn,$sql2);
echo "<script>alert('You made a repost');</script>";
}
?>
<?php
mysqli_close($conn);
}
?>