Jump to content

a search in a specified page!

Recommended Posts

I think that would have to be JavaScript. My implementation would be to find all text nodes in the DOM and do indexOf() for each of them; then (I imagine) you could highlight the ones you found.Why isn't Ctrl+F good enough?

Link to post
Share on other sites
Do you see the box search in the bottom of this topic? this is what i mean (:
If you want a search box on a web page, you will probably place it in an html form, and when that form is submitted, it will submit the form contents. (See the w3schools stuff on html forms).The page that receives the form submission (a PHP page in your case) will be a search results page, but it will contain some server-side script that executes a MySQL database query. You will have to design that query from your knowledge of what data is being searched and what results are to be returned. You say the "current page" is to be searched; therefore your query needs to search the database by reference to the data that was used to display that page. So the form fields you submit will probably need to include some context information about that (which will probably be hidden fields).The PHP page will take the results of the database query and format these results into html for the browser to display the search results page.
Link to post
Share on other sites

Join the conversation

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

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  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...