Page 1 of 1

Need help making database driven PHP site

Posted: Fri May 21, 2004 4:15 pm
by ghank
Ok, I am fairly new to PHP. What I do know is how to setup mysql and fetch the info. I have php files which fetch various templates which fetch the data and that works great. But now I am working on a new project and need to make 50,000+ more webpages. Before I would make the pages by hand. They were simple, but this many pages would take too long. All of the page names are different also. So does anybody know of a tutorial or have any tips on how to house all of the data for the pages in mysql? So I wouldn't have an actual php page, but a link to it that would pull it from the DB and make the page. The search engines would also need to believe it was a real page to index. I am thinking I would need to put something in the Htaccess file to get it started but I am lost and haven't been able to find an answer. Or maybe I need to have a php file in order to do this? Thanks in advance...

Posted: Fri May 21, 2004 4:53 pm
by James M.
You could pass data with links doin somthing like this:

<a href="page.php?data=something&data2=somethingelse">Link</a>

and that link would pass the variables $data and $data2 holding the values "something" and "somethingelse", respectively, to a page/ function (in your case it seems like a function).

well thats the way ive done it before and ive had no problems with it, but there could be a better way, im kind of new to php myself. Using the php function urlencode() helps in makin the links too.

http://us2.php.net/manual/en/function.urlencode.php

Posted: Fri May 21, 2004 8:03 pm
by ghank
Interesting! But doesn't the link look funky to the search engines? I need the pages to have my keywords in them and nothing else. My main goal is to get these pages to the top of the search engines with the minimal amount of effort. Yah, I am lazy, but why do more than you need to. This way I can spit out more pages and have more exposure.

Posted: Fri May 21, 2004 8:28 pm
by James M.
well u could make a form where with the name $search an in the MySQL query use a regular expression(REGEXP) to search the DB for what your looking for like this:

SELECT $row FROM $db WHERE $row REGEXP '$search'

im not sure about that REGEXP statement, im new at it but it looks like you'll need REGEXP. If you want to learn about it go to http://dev.mysql.com/doc/mysql/en/Regexp.html

Posted: Sat May 22, 2004 11:28 am
by ghank
Thanks James, I'll look into it.