-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathaddnews.php
More file actions
26 lines (22 loc) · 1.01 KB
/
addnews.php
File metadata and controls
26 lines (22 loc) · 1.01 KB
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
<?php
session_start();
//если логин и пароль введены,то обрабатываем их, чтобы теги и скрипты не работали, мало ли что люди могут ввести
$title = $_POST['title'];
$text = $_POST['text'];
$category = $_POST['category'];
$imglink= $_POST['imglink'];
$vidlink = $_POST['vidlink'];
$title = stripslashes($title);
$title = htmlspecialchars($title);
$text = stripslashes($text);
$text = htmlspecialchars($text);
$category = stripslashes($category);
$category = htmlspecialchars($category);
$imglink = stripslashes($imglink);
$imglink = htmlspecialchars($imglink);
$vidlink = stripslashes($vidlink);
$vidlink = htmlspecialchars($vidlink);
require_once('db_connect.php');
$db = new DB_CONNECT();
mysql_query("INSERT INTO `news` (`category`,`text`,`title`,`imglink`,`vidlink`) VALUES ('$category','$text','$title','$imglink','$vidlink')") or die(mysql_error());
?>