Go Back   CodingForums.com > :: Server side development > PHP

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 02-12-2012, 02:26 AM   PM User | #1
jmurphy45
New to the CF scene

 
Join Date: Feb 2012
Posts: 4
Thanks: 1
Thanked 0 Times in 0 Posts
jmurphy45 is an unknown quantity at this point
I can not find the error in my search engine

can you help

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html><head>

<meta content="text/html; charset=ISO-8859-1" http-equiv="content-type">
<title>search</title>


</head><body>

<center>
<h2>Review Nation</h2>
<form action="./search.php" method="get">
<input k="" size="50" type=" name=">
<input value="search" type="submit">
</form>

</center>

</body></html>






<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html><head>

<meta content="text/html; charset=ISO-8859-1" http-equiv="content-type">
<title>searchpage</title>


</head><body>
<h2>Review Nation</h2>

<form action="./search.php" method="get"> <input name="k" size="" 50="" value="" type="text">
<?php echo $_GET['k'];
<input value="Search" type="submit">
</form>

<hr>
<?php $k = $_GET['k']
$terms = explode(" ", $k);
$query = "SELECT * FROM search WHERE";
for each ($terms as $each){
$i++;

if ($i == i)
$query .= "keywords= LIKE '%each%' ";
else
$query .= " OR keywords= LIKE '%each%' ";
}
//connect
mysql_connect("50.63.227.187", "reviewsearch", "gjhghhbgftgyh");
mysql_select_db("reviewsearch");

$query = mysql_query($query);
$numrows = mysql_num_rows($query);
if($numrows > 0){

while ($row = mysql_fetch_assoc($query)){
$id = $row['id'];
$title = $row['title'];
$description = $row['description'];
$keywords = $row['keywords'];
$link = $row['link'];

echo "<h2><a href='$link'>$title</a></h2>
$description<br /><br />";

}
else
echo"No results found for \"<b>$k</b>\"";

//disconnect
mysql_close();


?>
</body></html>

Last edited by jmurphy45; 02-12-2012 at 02:35 AM..
jmurphy45 is offline   Reply With Quote
Old 02-12-2012, 12:44 PM   PM User | #2
aidankay
New Coder

 
Join Date: Feb 2012
Posts: 17
Thanks: 4
Thanked 1 Time in 1 Post
aidankay is an unknown quantity at this point
What sort of error are you getting?
aidankay is offline   Reply With Quote
Old 02-12-2012, 12:47 PM   PM User | #3
KuriosJon
Regular Coder

 
Join Date: Jan 2012
Posts: 134
Thanks: 0
Thanked 32 Times in 32 Posts
KuriosJon is on a distinguished road
I'd like to know as well. A quick glance though and I noticed this:

Code:
<input k="" size="50" type=" name=">
Looks like you have a syntax error somewhere...probably a missing quote. The code you pasted looks like it was generated using firebug or something similar. It will often try to fix missing quotes and you get weird stuff happening like the above.

Look at your code again for missing quotes. If the code you pasted wasn't from a debugging tool, then start by fixing the attributes on that input.
__________________
Roundabout Time Tracking
KuriosJon is offline   Reply With Quote
Old 02-20-2012, 05:51 PM   PM User | #4
jmurphy45
New to the CF scene

 
Join Date: Feb 2012
Posts: 4
Thanks: 1
Thanked 0 Times in 0 Posts
jmurphy45 is an unknown quantity at this point
Quote:
Originally Posted by KuriosJon View Post
I'd like to know as well. A quick glance though and I noticed this:

Code:
<input k="" size="50" type=" name=">
Looks like you have a syntax error somewhere...probably a missing quote. The code you pasted looks like it was generated using firebug or something similar. It will often try to fix missing quotes and you get weird stuff happening like the above.

Look at your code again for missing quotes. If the code you pasted wasn't from a debugging tool, then start by fixing the attributes on that input.
I looked at it again and it does look a syntax error. Could I make a page that would allow people submit sites to the data base
jmurphy45 is offline   Reply With Quote
Reply

Bookmarks

Tags
coding, php

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 06:25 AM.


Advertisement
Log in to turn off these ads.