Hi everyone. I have a printer supply website and I often offer some combo deals and other offers on the bottom of my pages. Until this time if I wanted to change the promotions because lets say the coupon codes had expired I just made new ones on one page and went all over the other pages and pasted them. But I found this little stupid and very time consuming. Can somebody tell me how could I change one page and the rest of my pages would change as well? I heard about cascading style sheets but I have no idea how to do it. Can somebody please advice me? I will appreciate any help. Thank You Laszlo.
Hi Laszlo You've come to the point where site owners decide to have "dynamic pages". This can be as simple as using ASP or PHP to build pages and "include" headers and footers and standard segments and can be as complicated as using a Content Management System (trial the free ones at www.opensourcecms.com) In the first case your coupon info would be in a "common script" which each page would be able to use. When the coupons changed you change one script and all the pages would change automatically. You now need to decide how much time you are prepared to spend learning new systems, coding language etc versus how much money you are prepared to spend. Spending time will save you money, spending money will save you time. You won't regret the site upgrade
I wouldn't exclude the use of JavaScript. I agree that PHP, ASP, CF are probably where you'd want to be heading, but if you're not ready to go that route quite yet, check out a simple JS include. http://www.webmasterworld.com/forum89/818.htm (first example I found)
Agree with sarak here, javascript is a no-no. php includes are really easy, all you gotta do is built your html page and give it a .php extension. This is what I do: I build the entire homepage in html, then I cut everything above the content into header.php, everything below the content into footer.php, and do an includes: <? include("filename.php") ?> To call the file in the correct place. Additionally, you can run an include for other things that might suck if you had to go through and change a bunch of stuff, like adsense blocks etc. Thus, my page layout would look like this: --------------- (content.php) --------------- Meta info <? include("header.php") ?> All my content, which may have an adsense includes <? include("footer.php") ?> ------------------------------------------------ Now, if I need to change my header, adsense code, footer, add navigational links, etc. I can do it all in 1 file for sitewide changes. Want to change the entire template for your site? No problem, since the only thing hardcoded into a bunch of pages in your content, you can change everything else around it by editing header and footer.php
True and true (but not about being a pig to code ). But, again, if you're on a server that doesn't support PHP, ASP or CF (which means you need to get a new host), or you don't want to go that route ... (after all, to use one of these new methods, you'll have to rename all of the files that you want to include this on - based upon what they've said above ... well, this could be a whole load of fun - depending upon future plans, this may be necessary anyways) Depending upon how often the content is changing, I just don't think indexing is going to be that big of a deal. Otherwise than that, I completely agree. But, it all begs the question which should have been asked first off: What file type are you currently using Laszlo? HTML, PHP, CFM, ASP, SHTML?
Any half-pie decent host will support one of these, and you get what you pay for. If you are making money from the site, which you must be, then sometimes you have to pay to have decent business tools Simple mod_rewrite or .htaccess changes can fudge all that. It's no biggie. From the original post it was clear that the pages were pure html. Not that they had to be pure html, but that they were.
I'm just trying to say, as un-hostile as possible, that saying one solution is the answer just doesn't work very well. PHP may not be the solution. Heck, it may be better to pass all HTML files as SHTML, and use SSI. That's all that I really wanted to get to. I've just seen far too many people go through fairly major changes, without knowing the complete background of what they're doing. Since I now know you'll point these supplementaries out, I'll leave it to you.
Wow 7 replies in a few hours. That’s certainly appreciated. Thanks for all of you. So make the long story short I have to learn something about PHP (or SSI). O and find out if my web host (Yahoo) supports it at all. I remember once I experimented with an ASP extension for a form but Yahoo turned me down saying they don't support it. Until I get familiar with this Whole PHP thing I think I won't make promotions that change on a set time base. Thanks for the contribution, Laszlo.
Laszlo, don't worry about learning too much at once. mdvaldosta's post is great--a php include is a great place to start. php can do a lot more, but just that little command will make your life much, much easier!
Laszlo, I have experienced the power of SSI for my recent 2-3 websites that I've produced. I must say it cuts down considerable amount of time! Prior to this, I also had to change every header in every page (and cursing myself when doing that, LOL). Most hosting provider out there supports SSI and PHP. ASP? Not too sure.
Laszlo, the only bit of php you need to know is the <? include("filename.php") ?> that mdvaldosta was talking about, but the include can be included in a html file (with a small mod to your .htaccess file not too difficult either) and the actual file could be a .txt file with your html code in it. I have used this on some of my sites, and where you want the coupon or offer to appear you place the include code above, and just paste your html in the file it points to. when you update the .txt file it will update in all the pages with the include code.
Actually, for security purposes, they don't suggest you put code into an HTML file. It's best to actually use the correct file extension. This is more towards pages that are actually generated on the file, but, nonetheless, it's a good standard to get into the habit of.