Hi, ive created a simple search engine for a college project ive been working on. Heres the code...
<?php session_start();
if ($_SESSION['logged'] != true)
{
header('location: register.php');
exit();
}
?>
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>jobs</title>
<meta name="generator" content="TextMate http://macromates.com/">
<meta name="author" content="Red Davis">
<!-- Date: 2007-05-08 -->
<link rel="stylesheet" media="screen" type="text/css"
href="style.css"/>
</head>
<body>
<div id="header">
<div id="header1"> </div>
<div id="header2"> </div>
<div id="logo"> </div>
<div id="header3"> </div>
<div id="tabs"> </div>
</div>
<div id="leftbar"> </div>
<div id="links1"
<div id="home"><a href="index_logged_in.php">Home</a></div>
<div id="investor"><a href="investor.htm">Investor</a></div>
<div id="jobs"><a href="jobs.php">Jobs</a></div>
<div id="register"><a href="register.php">Register</a></div>
</div>
<div id="welcome">
<?php echo "Welcome, ".$_SESSION['username'] ; ?>
</div>
<div id="logout">
<a href="logout.php">Logout</a>
</div>
<?php
include ("name.inc");
mysql_connect ("$host","$username","$password")
or die ("couldnt connect");
mysql_select_db ("$database")
or die ("cannot select database");
//set variables
$request = $_GET['dropdown'];
$search = mysql_query("SELECT * FROM $table2 WHERE jobtype='$request'")
or die (mysql_error());
while ($row = mysql_fetch_array($search)) {
echo $row['jobtitle']."<br>";
}
?>
<div id="rightbar"> </div>
</body>
</html>
The search works fine but i want it to return links. So that if the user searched programmer jobs, the search would return the job title and a link to the full article (which would contain jobdescription). A bit like the youtube search.
Thanks for your help, Red