Yesterday I spent the day keeping myself busy with my blog supplement pages. I'm finally taking the time to learn php. I'm re-writing all my non-blog pages in php. The great thing about that is if I want to change something in the sidebar or whatever, I don't have to go through and make that same change over and over in the html code for each individual page. I'll change it once in the main php code, and it will take effect on every page.
The actual blog is hosted by Blogger, and thus will be unaffected by all of this.
Basically, I'm using the require() function to paste in all the code that is the same on every page; things like the sidebar and footer. It reduced the actual .html files for the web pages down to the content that is unique to that page. As an example, my template page that I use to create new pages was 200 lines (before actual content is added), now it is 31 lines.
None of the web addresses or file names are going to change, though. You'll notice they still have their .html extension. In fact, the files themselves are still .html files. I just told it to run .html as a php file with a little .htaccess magic:AddType application/x-httpd-php .php .htm .html
AddHandler x-httpd-php .php .htm .html
Also, the non-www version of my web address finally 301 redirects to http://www.mastermarf.com, as I've wanted it to all along.
I'm sure there's so many neat things I could do with php, I'm just beginning.
Tuesday, December 23, 2008
«Learning PHP»
Subscribe to:
Post Comments (Atom)
Label Cloud
About Me
Alaska
Animals
Anonymous
Art
Atheism
Bicycle
Blog Reactions
Blog Upgrades
Blogger
Blunt Honesty
Buildings
Caturday
Clothing
Code
Comics
Computers
Copyright
Cruise Ship Watch
Death
Desktop Backgrounds
Disasters
Doomsday
Economy
eMail
Emergency
Energy
Flying Spaghetti Monster
Food
Free Speech
Friends
Games
Gay Rights
Google
Goth
Holidays
Idaho
Idle Mind
Illness
Injury
Internet
Japan
Jury Duty
Ketchikan
Large Hadron Collider
Lasers
Law
Lies
Magic: the Gathering
Master Marf
Meme
Milestones
Money
Motivational Monday
Mountain
Mountain Dew
Music
Musical Taste
Photos
Poems
Politics
Polls
Pony
Power Outage
Problems
PSAs
Random
Reader Opinion
Reader Submission
Relationships
Religion
Scam
Science
Science Fiction
Scientology
Screenshots
Sea-Monkeys
Ships
Sims 3 Legacy
Social Norms
Software
South Park
Space
Stupidity
Technology
The Game
Tourism
Trail
Unusual Ads
Vacation
Weapons
Weather
Web Feeds
Word Play
Work
YouTube
Some Rights Reserved
4 comments:
Thanks for taking the time to comment.