1
by Danial Behzadi
created base files |
1 |
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
|
2 |
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
|
3 |
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> |
|
4 |
||
5 |
<head> |
|
6 |
<title>FSUG Movie Manager - Addding new movie</title> |
|
7 |
<meta http-equiv="content-type" content="text/html;charset=utf-8" /> |
|
8 |
<meta name="creator" content="Danial Behzadi" /> |
|
9 |
<meta HTTP-EQUIV="REFRESH" content="3; url=index.php"> |
|
10 |
<link rel="stylesheet" type="text/css" href="css.css" /> |
|
11 |
</head> |
|
12 |
||
13 |
<body> |
|
14 |
<?php
|
|
15 |
// Create Connection
|
|
16 |
include 'connect.php'; |
|
17 |
mysql_select_db("collection", $con); |
|
18 |
||
8
by Danial Behzadi
added comments |
19 |
echo "<table align='center' style='width:65%'>"; |
20 |
||
7
by Danial Behzadi
improvments in index and insert |
21 |
if ($_POST[name]) |
22 |
{
|
|
23 |
$sql="INSERT INTO Movies (Name, Year, Director, Genre, Tags) |
|
24 |
VALUES
|
|
25 |
('$_POST[name]','$_POST[year]','$_POST[director]', |
|
26 |
'$_POST[genre]','$_POST[tags]')"; |
|
27 |
||
28 |
if (!mysql_query($sql,$con)) |
|
29 |
{
|
|
30 |
die('Error: ' . mysql_error()); |
|
31 |
}
|
|
8
by Danial Behzadi
added comments |
32 |
echo "<tr><th>Done!</th></tr>"; |
33 |
echo "<tr><td><p align='center'>Movie '$_POST[name]' added</p></td></tr>"; |
|
7
by Danial Behzadi
improvments in index and insert |
34 |
}
|
35 |
else
|
|
1
by Danial Behzadi
created base files |
36 |
{
|
8
by Danial Behzadi
added comments |
37 |
echo "<tr><th>Oops!</th></tr>"; |
38 |
echo "<tr><td><p>Something went wrong</p></td></tr>"; |
|
1
by Danial Behzadi
created base files |
39 |
}
|
8
by Danial Behzadi
added comments |
40 |
echo "<tr><td><p>if you didn't redirected automatically<br /> |
41 |
<a href='index.php'>click here</a></p></td></tr>"; |
|
42 |
echo "</table>"; |
|
1
by Danial Behzadi
created base files |
43 |
|
44 |
mysql_close($con) |
|
45 |
?>
|
|
46 |
||
47 |
</body> |
|
48 |
||
49 |
</html> |