Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!doctype html>
- <html>
- <head>
- <meta charset="utf-8">
- <title> Wesco Search </title>
- </head>
- <body>
- <form action="search.php" method="POST">
- <input type="text" name="searchterm" placeholder="Search..."><br />
- <input type="submit" value="Search">
- </form>
- </body>
- </html>
- <!doctype html>
- <html>
- <head>
- <meta charset="utf-8">
- <title>Part Search</title>
- </head>
- <body>
- <?php
- $username = "xxxxx";
- $password = "xxxxx";
- $hostname = "localhost";
- //connection to the database
- mysql_connect($hostname, $username, $password);
- mysql_select_db("wesco");
- $search = mysql_real_escape_string(trim($_POST['searchterm']));
- $find_parts = mysql_query("SELECT * FROM 'parts' WHERE 'keywords' LIKE'%$search%'");
- while($row = mysql_fetch_assoc($find_parts))
- {
- $name = $row['name'];
- echo "$name<br />";
- }
- ?>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement