~dani.behzi/pfcm/pfcm

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
45
46
47
48
49
<!DOCTYPE HTML>
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">

<head>
	<title>untitled</title>
	<meta http-equiv="content-type" content="text/html;charset=utf-8" />
	<meta name="creator" content="Danial Behzadi" />
	<meta HTTP-EQUIV="REFRESH" content="3; url=index.php">
	<link rel="stylesheet" type="text/css" href="css.css" />
</head>

<body>
	<?php
		// Create Connection
		include 'connect.php';
		mysql_select_db("collection", $con);
		
		$id=$_POST[id];
		
		echo "<table align='center' style='width:65%'>";
		
		if ($_POST[name])
		{		
			$sql="INSERT INTO Moviescomments (ID, Name, Email, Website, Comment)
			VALUES
			('$id','$_POST[name]','$_POST[email]','$_POST[website]','$_POST[comment]')";
			
			if (!mysql_query($sql,$con))
			{
				die('Error: ' . mysql_error());
			}
			echo "<tr><th>Done!</th></tr>";
			echo "<tr><td><p align='center'>Your comment has been added</p></td></tr>";
		}
		else
		{
			echo "<tr><th>Oops!</th></tr>";
			echo "<tr><td><p>Something went wrong</p></td></tr>";
		}
		echo "<tr><td><p>if you didn't redirected automatically<br />
			<a href='movie.php?id=$id'>click here</a></p></td></tr>";
		echo "</table>";	
		
		mysql_close($con)
	?>
	
</body>

</html>