-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinfo.php
43 lines (27 loc) · 1.45 KB
/
info.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
<?php
include('config/db.php');
session_start();
$_interests = $_vk = $_facebook = $_instagram = "";
$id_user = $_SESSION['id'];
if(isset($_POST["submit"])) {
$interests = $_POST["interests"];
$vk = $_POST["vk"];
$facebook = $_POST["facebook"];
$instagram = $_POST["instagram"];
$_interests = mysqli_real_escape_string($connection, $interests);
$_vk = mysqli_real_escape_string($connection, $vk);
$_facebook = mysqli_real_escape_string($connection, $facebook);
$_instagram = mysqli_real_escape_string($connection, $instagram);
/*if((preg_match("/^(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])$/", $_interests)))*/
$sql_interests = "UPDATE users SET interests = '{$interests}' WHERE id = '{$id_user}'";
mysqli_query($connection, $sql_interests);
$sql_vk = "UPDATE users SET vk = '{$vk}' WHERE id = '{$id_user}'";
mysqli_query($connection, $sql_vk);
$sql_facebook = "UPDATE users SET facebook = '{$facebook}' WHERE id = '{$id_user}'";
mysqli_query($connection, $sql_facebook);
$sql_instagram = "UPDATE users SET instagram = '{$instagram}' WHERE id = '{$id_user}'";
mysqli_query($connection, $sql_instagram);
}
header('Location: /dashboard.php', true, 301);
exit();
?>