-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvideo_insert.php
44 lines (42 loc) · 1.32 KB
/
video_insert.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
<?php
include("includes/funzioni.php");
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Video insert</title>
</head>
<body>
<?php
if (isset($_POST['videos_insert'])) {
$db = apri_connessione();
for ($i=0; $i<$_POST['max_rows']; $i++) {
$query = "INSERT INTO `avideo`.`av_videos` (
`host` ,
`host_video_ID` ,
`title` ,
`description` ,
`thumbnail_default` ,
`thumbnail_medium` ,
`thumbnail_high`,
`timestamp_insert`,
`timestamp_edit`
)
VALUES (
'".$_POST['host']."', '".$_POST['host_video_ID_'.$i]."', '".mysql_real_escape_string($_POST['title_'.$i])."', '".mysql_real_escape_string($_POST['description_'.$i])."', '".$_POST['thumbnail_default_'.$i]."', '".$_POST['thumbnail_medium_'.$i]."', '".$_POST['thumbnail_high_'.$i]."', '".$current_timestamp."', '".$current_timestamp."'
);
";
if (!$result = mysql_query($query, $db)) {
echo mysql_error()."<br />";
echo $query."<br />";
mysql_close($db);
die("Problemi l'esecuzione della query.");
}
}
echo $_POST['max_rows']." video inseriti correttamente nel DB.";
mysql_close();
}
?>
</body>
</html>