Jump to content

Recommended Posts

Hi All,

 

I am working on a site and am using a free template, I noticed that the header bar has the following for a search script that I thought I would utilise:

 

<input id="s" type="text" name="s" value="" />
		<input id="x" type="submit" value="Search" />

 

However, I have no idea where to start!

 

I want the results to be pulled from a table called stocks and to search the description coloum for matching words.  I have a number of questions which I hope someone can answer

 

1, Does anyone have any good links/examples for something like this?

2, How would I display the results in a different page from header?

 

Many Thanks

Link to comment
https://forums.phpfreaks.com/topic/179972-search-mysql-from-php-page/
Share on other sites

Here is a basic tutorial to get you started

http://www.spoono.com/php/tutorials/tutorial.php?id=12

 

However do not use this in a live website. This tutorial does not explain how to sanitize (make safe) any user inputted data prior to using in a database query.

Here are some pages on this topic:

http://www.phpro.org/tutorials/Filtering-Data-with-PHP.html

http://uk2.php.net/strip_tags

http://uk2.php.net/mysql_real_escape_string

 

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.