NamePros
Welcome, Guest! Ready to make a name for yourself in the domain business? We welcome both the hobbyist and professional domainer to join the discussion as part of the NamePros community.

Click here to create your profile to start earning reputation for posting, and trader ratings for buying & selling in our free e-marketplace. Build your trader rating with each successful sale. Our system has tracked over 100,000 sales and counting!
FAQ & TOS Register Search Today's Posts Mark Forums Read

Go Back   NamePros.com > Website Development Discussion Forums > Programming > Webmaster Tutorials
Reload this Page Search Page

Webmaster Tutorials Instructional webmaster-related how-to's and tutorials.

Advanced Search
0 members in live chat ~  


Closed Thread
 
LinkBack Thread Tools
Old 03-04-2006, 01:20 PM THREAD STARTER               #1 (permalink)
NamePros Regular
 
asgsoft's Avatar
Join Date: Sep 2005
Location: At Home
Posts: 881
asgsoft is a glorious beacon of lightasgsoft is a glorious beacon of lightasgsoft is a glorious beacon of lightasgsoft is a glorious beacon of lightasgsoft is a glorious beacon of lightasgsoft is a glorious beacon of lightasgsoft is a glorious beacon of lightasgsoft is a glorious beacon of light
 



Search Page


OK This tutorial will show you how to make a search page.

Firstly we make a form. I am going to use this:

PHP Code:
<form method="post" action="searchpage.php">
<
p>Please enter keyword.</p>
<
p>
<
input name="word" type="text" size=25 maxlength=25>
</
p>
<
p>
<
input type="Submit" name="Submit" value="Submit">
</
p>
</
form
This is the form where we will enter the keywords. Now the next step is to make the searchpage.php.

It will look like this

PHP Code:
<?php
????: NamePros.com http://www.namepros.com/webmaster-tutorials/173480-search-page.html
// connect to db
$db mysql_connect("localhostt""username""password");
mysql_select_db("dbname",$db);

//check something is sent
if ($_POST['word']) {
$word$_POST["word"];
// search query
$result mysql_query("SELECT * FROM `table` WHERE `field` LIKE '%$word%'");
$postword $_POST['word'];
echo 
"Search Results for: <strong> $postword </strong> <br />";
echo
"<p> </p>";
????: NamePros.com http://www.namepros.com/showthread.php?t=173480
echo
"<p> </p>";
echo
"<p> </p>";
echo
"<p> </p>";
//get results
while($get=mysql_fetch_array($result))
{


$date $get['date'];
$name $get['name'];
$title$get['title'];

//show results
echo("<strong>$title</strong> was added on <strong>$date</strong> by <strong>$name</strong>");

echo
"<p></p>";
echo
"<p></p>";
}
// if nothing is sent
}else {
die (
"No search word specified");
}

?>
asgsoft is offline  
Closed Thread


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools


Similar Threads
Thread Thread Starter Forum Replies Last Post
How Search Engines Work Cyberian Domain Newbies 6 01-09-2006 02:39 PM
Why You Need Search Phrase Customizer ... dgridley For Sale / Advertising Board 0 11-08-2005 04:40 PM
search function on everypage or search page deadhippo Web Design Discussion 5 06-15-2005 07:13 AM
60.000 Templates, scripts, fonts, banners etc. $9.95 atkims Web Development Wanted 19 11-16-2004 09:48 AM

 
All times are GMT -7. The time now is 12:57 AM.

Domain name forum recommended by Domaining.com Powered by: vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.6.0 Ad Management plugin by RedTyger