Help - Search - Members - Calendar
Full Version: Fetch and redirect?
HTMLHelp Forums > Programming > Server-side Scripting
Ataru
Hello,
I'd like to set up a PHP script that will, when someone types something in to a text box, redirect them to the correct page. For instance, say I have a folder with 500 pages in it. One is entitled, "Pogona_vitticeps.php". This is the page that displays information on the central bearded dragon. So either central bearded dragon or Pogona vitticeps in any case needs to redirect to this page.
Someone told me to use the similar_text() function, but really I'm not sure how to do it.
Thanks!
Ataru
OK, I've done some searching and found out that scanning database rows is a lot faster and more secure than files in a folder. That I can easily believe. My problem now is how to get these pages to correspond to a database and then to my PHP.
...any suggestions? Thanks!
viju
i would like to ask about how i can access database records using this server side scripting language asp?
Brian Chandler
QUOTE(Ataru @ Dec 21 2007, 01:16 AM) *

OK, I've done some searching and found out that scanning database rows is a lot faster and more secure than files in a folder. That I can easily believe. My problem now is how to get these pages to correspond to a database and then to my PHP.
...any suggestions? Thanks!


If you really have one file for each page already created (by hand?), then then all you need is a map from names to page addresses - you don't need to store the whole text of each page in the database. Just a two column table

filename | keyword

You might want to accept more than one name for some files. You also might want to display a complete list - suppose someone can't remember how to spell the name they're looking for.

You need to learn the basics of creating and accessing a database (which should take a few days, depending); then the PHP manual has all the functions you need to access MySQL (assuming that's what you are using).

This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2010 Invision Power Services, Inc.