-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsend.php
37 lines (32 loc) · 1.17 KB
/
send.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
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>Send</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" type="text/css" media="screen" href="css/bootstrap.min.css" />
<link rel="stylesheet" type="text/css" media="screen" href="css/style.css" />
<script src="main.js"></script>
</head>
<body>
<?php
//on se connecte à la bdd
$db = new PDO('mysql:host=localhost;dbname=tchat','root', '');
//$db = new PDO(mysql:host=localhost;dbname=basemmi171da08', 'mmi171da08','ueg6');
//send.php?username=Badr&message=slt&perso=conan&bubble=white&power=opacity&likes=0
//on recupère le pseudo et la phrase depuis l'url :
//dire.php?pseudo=totophrase=bonjour...
$username = $_GET['username'];
$message = $_GET['message'];
$perso = $_GET['perso'];
$bubble = $_GET['bubble'];
$power = $_GET['power'];
$likes = $_GET['likes '];
$requete = 'INSERT INTO tchatv2 VALUES (
null, "' . $username . '", "'. $message . '" , "'. $perso . '" , "'. $bubble . '" , "'. $power . '" , "'. $likes . '" , NOW()
)';
$db->query($requete);
?>
</body>
</html>