|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
.html to .php
Hey,
Right now I have about 185 webpages for my site and they are growing extremely fast. I am also using Dreamweaver right now to work on site since I have very minimal knowledge of databases. Since the site is growing so fast I want to convert it to a database format so it is easy to organize. I was talking to someone and he told me that to convert the site to database I must have all the pages as .php instead of .html I can make my future webpages in .php and it is not a problem. Do you guys suggest that I should make my future webpages to .php so it will be easier to convert to a database driven site in the future or not? Thanks a lot. |
|
#2
|
||||
|
||||
|
If you set the server up to treat .html files as .php files it doesn't matter if they're .html or .php
Believe me, when it comes to converting a site from static to dynamic it doesn't matter how well you prepare, things are tough. The best advice is to do it is as soon as possible. The longer you wait the harder it will become to switch. |
|
#3
|
|||
|
|||
|
How would you treat the .html file as a .php file?
|
|
#4
|
||||
|
||||
|
Re: .html to .php
Quote:
PHP is only one options for creating a database-driven website (though it is the most popular by far). If you're interested in learning how to create a dynamic website using PHP and MySQL (this would be the database), I recommended getting this book - it'll walk you through the steps necessary to achieve what you're talking about.
__________________
Give a person code, and they'll hack for a day; Teach them how to code, and they'll hack forever. Analyze twice; hack once. The world's first existential ITIL question: If a change is released into production without a ticket to track it, was it actually released? About DrGroove: ITIL-Certified IT Process Engineer - Enterprise Application Architect - Freelance IT Journalist - Devshed Moderator - Funk Bassist Extraordinaire |
|
#5
|
||||
|
||||
|
To treat a .html file as a .php file you need to make the server send .html files to the php engine. For files that don't include php code there will be no apparent change, maybe a little extra time overhead.
|
|
#6
|
|||
|
|||
|
There is an easier way than re-naming all of your '.htm' page to '.php'... but still using PHP. Create a file in notepad called .htaccess with this line "AddType application/x-httpd-php .htm .html" (no quotes) and upload it to the root directory of your website, make sure it's named '.htaccess'
This tells your website server to look for any .htm or .html pages and treat them as if they where a .php page... all without even renaming you pages! You don't even have to update your links, all of your .html or .html pages should be able to run PHP now. |
|
#7
|
|||
|
|||
|
To reply to the original poster..
ignore the discussion here about the server treating files with a .html extension as a php file. That is a tagent not related to what you were asking. To write a database-driven site would involve more than have all of your pages written in php. There are new considerations to make as far as construction. Instead of hundreds of pages, you could end up with only four or five pages.. it just depends on what you are doing with them. Writing the page in PHP now without a database behind it will not prepare the site for when it is database driven.. it would, however, be pretty good practice for you. listen to drgroove.. |
|
#8
|
||||
|
||||
|
Would SSI be considered? I usually have a top and bottom include file that contain everything except the content on that page. I can change virtually everything (header, menu, footer) with one file.
__________________
Family Hosting, we treat you like family! United Web Site Award Givers, is your website worthy of an award? |
|
#9
|
|||
|
|||
|
Executive: what?
|
|
#10
|
||||
|
||||
|
I was just thinking SSI may be another option for you.
|
|
#11
|
|||
|
|||
|
FYI:
He's talking about Server Side Includes, which is an older method of producing dynamic content. Pages that end in .shtml are probably using SSI.
__________________
|
|
#12
|
||||
|
||||
|
Using SSI, you can also include a php script in a html file, much like you would a CGI-based counter.
<!--#include virtual="path/to/phpscript.php"--> It even works with queries like... <!--#include virtual="path/to/phpscript.php?var1=something"-->
__________________
Matt |
![]() |
| Viewing: Dev Shed Forums > Web Design > Web Design Help > .html to .php |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|