I have an html form which brings up an input box, which is this
<!DOCTYPE html>
<html lang="en">
<head>
<title>Browse</title>
<meta charset="utf-8"/>
<link rel="STYLESHEET" type="text/css" href="../../style/Browse.css">
</head>
<body>
<form>
<form name="input" action="Browsing.php" method="post">
Search <input type="text" name="search" />
<input type="submit" value="Submit" />
</form>
</form>
</body>
</html>
Then I have a php page which handles the input from that html page, the code is this
<?php
$search= $_POST['search'];
$con = mysql_connect("localhost","user","pass");
if (!$con) {
die('Could not connect: ' . mysql_error());
}
mysql_select_db("db", $con);
$result = mysql_query("
SELECT videos.videoname, videos.id_video
FROM videos
WHERE videos.videoname=$search
");
echo "Videos:";
while ($row = mysql_fetch_array($result)) {
$link=$row['videoname'];
$file_location=$row['id_video'];
echo "<div id=\"Search_Browse\">";
echo "<a href='uploads/upload/browseplayer.php?num=$file_location'>$link</a>";
echo "</div>";
}
mysql_close($con);
?>
But it does not display the code onto the page, it just puts ?search=example into the url box