Page 1 of 1

htm files in database

Posted: Fri Oct 24, 2003 6:57 am
by bill2000
Hi

I did my web site with 25,000 files ( htm ) of food receipes
With powweb ( hoster ) we have a limit of 15,000 files
So what they told me is
------------------------------
Thank you for contacting Powweb Technical Support regarding your package.
On a site like that, it may be a better idea to save your information in a database. That way your file count does not increase and you still are able to store new recepies.
------------------------------
1.) Is it hard to change the htm files
2.) How can I do it, are where to go to learn it.

ThanKs to help me
BiLL2oo0

Posted: Fri Oct 24, 2003 12:31 pm
by Johnm
I would consider creating tables in the database with the recipes in the table and have one page querry the table for the recipie that the user wants to see.

John M

Posted: Fri Oct 24, 2003 5:22 pm
by JAM
As Johnm mention, a extremely simple one-page driven example of that:

http://www.example.com/recepies.php?id=14223

Code: Select all

<!-- the recepies.php page -->
<html>
<body>
<?php
 // query the database based on the $_GET in the above example URI...
 // "select * from table where recepies_id = '14223'"
 // printout the info from the above, and so on, and so on
?>
</body>
</html>
By doing this, you have one page (or file, if you may) that dynamicly changes the recepie according to a certain id, as you can spot in the example URI.

1. I wouldn't think so. As I imagine that the structure of each page does not differ much from each other... It does not require to much learning (assuming you are not to familiar with PHP/databases.

2. php.net's manual pages are a good first place visit. Pointers on how to start you can get from this board, but you should be ready to actually do some work.

Posted: Sat Oct 25, 2003 11:50 am
by McGruff
First step to learning php/mysql would be to install a local server: http://www.hotscripts.com/PHP/Software_ ... tion_Kits/

A couple of tutorial sites where you'll find articles on php & mysql:
http://www.w3schools.com/default.asp
http://www.onlamp.com/php/

Good intro to database design: http://www.oreilly.de/catalog/javadtabp ... r/ch02.pdf

Check out the links from this site, php.net and zend.com for various php links & tutorials.

If you've got thousands of files it should be possible to write a script to extract content and insert to a database BUT only if they use the same html template. That requires pattern matching - not easy if you're new to programming but you'll probably be able to get someone to help you with the hard bit.

If you'd be happy using something ready rolled, take a look at hotscripts.com for a CMS like postnuke. Wouldn't be surprised if you can find something specifically for recipes there.