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
|
<?php require("configure.php"); ?> <? $videoid = $_POST["videoid"]; $videotitle = $_POST["videotitle"];
$sql = "select max(videoid) as maxid "; $sql .= "from video"; $result=mysql_query($sql); $row = mysql_fetch_array($result,MYSQL_ASSOC); $videoid = $row{maxid}+1;
// Product image if ($_FILES['image']['name'] <> '') { move_uploaded_file ($_FILES['image']['tmp_name'], "video/".$videoid.$_FILES['image']['name']) or die ("Could not copy, File Size Max.2M and change the filename to all english."); $image = $videoid.$_FILES['image']['name']; } else { $image = ""; }
$sql = "insert into video (videoid, videotitle, videofile) values ('$videoid', '$videotitle', '$image')"; //echo $sql; mysql_query($sql); mysql_close($dbh);
header("Location: videoindex.php?msg=Add Successful"); ?>
|