|
just another regularban.info web blog |
| MEMBERS: | Reusing Code in Web Sites and Applications Part 1 - Using Include() and Require()
Reusing pieces of HTML code is a common way of making web sites (or web applications) more consistent, reliable, and more manageable. Even a small web site consisting of perhaps 20 or 30 web pages can benefit from reusing code for header and footer sections, for example. If the same header or footer is used across all the pages on the site, it makes sense to put the header and footer code in separate files, and then call those files to insert their contents where required. PHP offers two statements that can be used for inserted the contents of one file inside another: include() and require(). These two statements are virtually identical, with the only real difference being that if require() fails, it gives a fatal error, whereas if include() fails it just gives a warning. For this reason I tend to use the include() statement as it just seems slightly more friendly. So, to include the contents of a file called header.inc inside a web page called index.php, you would just need to insert the following line of code (wrapped in PHP opening and closing tags) inside index.php. Include 'header.inc'; As PHP takes no notice of the extension used for the included file, you can use whatever extension you want to. Be careful though, if you put passwords inside an include file with a .inc extension, they will be visible. You can get around this by putting include files that contain sensitive information outside the document tree to prevent people from browsing to them. In Part 2 we'll look at the use of functions when developing web sites and applications.
My Tip For Creating Websites
So you want to build a website and at this point you may be very excited. There seems to be so much opportunity online that it seems that you cannot go wrong. You read all those sales pages out there telling you that you only need work fifteen minutes a day and you will make thousands. Forgive me I am being a little dramatic but I think you get the picture. The solid fundament when it comes to building websites is to understand why people go online. Number one they go online for information. This information can be entertaining or solution orientated. It can also be sought out for research purposes. So the first question is which category do you fall into? Now let me give you that tip. If you are interested in a subject lets take health as an example its imperative at the outset to have an open mind. What you think may work, may not so you have to be prepared for that. Secondly you need to make sure and research thoroughly so that when you make the decision you can at least know that you have done your homework and therefore your odds of success are far greater. Let me tell you what happened to me. I went out bull headed and just picked a topic that I was interested in and was not adaptable at all. Then I just built a site and put a lot of work into it but got very little results. Then of course I lost motivation and before you know it I almost got burnt out. I cannot tell you how depressing it is when your dream of working online becomes a nightmare of failure. To conclude keep it simple, be adaptable, focus heavily on research and understand that it takes work so don't be easily influenced by all sorts of hype that will in essence only distract you.
Small Business Web Site Development, Design & Hosting
Anybody who wants to start a business looks for minimum investment & maximum returns, especially small businesses where capital is low. The cheapest mode of marketing your business & letting people know about your products/services is internet. That's the reason why lots & lots of small business enterprises are now looking for internet marketing as a new potential area of business. Of course, to promote your business online, you need to have a powerful website. A website is a virtual portal containing information about your company, products & services. You can either setup an online store & sell products thereon, or you can simply provide your contact information on your website, so that people can contact you for your services. In either case, it is very important that you design an attractive website so that users get drawn to it. Attractive does not mean loads of graphics & colors. But it means a site that has balance of all. A good website has a decent layout, great information & is easily accessible. Too much graphics, flash & other such factors delay the downloading of the site, which can be frustrating to user. It also means it is difficult to promote it through search engines freely. The best solution is to approach a professional company & make your goal clearer to them. For a little investment, you can get a great website ready to market. A properly designed website goes a long way to determine your online business. If you can increase your customer base online, you can then think of creating your brand offline as well. Once people start visiting your website & you offer them services/products online, you can built a base to your business wherein you can expand it offline as well. Lot of companies provide complete package for small business website development, design & hosting. These services also extend to online promotion of your site like search engine optimization services. So, in short, you can hire a company that can manage your entire online business. While choosing a company, you can either be specific about how you want your website designed, developed or hosted; or you can just provide them with your business idea. Of course, you should be prepared to offer your services/products once customers start pouring in. So, if you are planning to start a small business then developing a website is the first step you should take.
|
* About Archives
Categories:
Last Updated: |
| regularban.info
is proudly powered by WordPress MU running
on regularban.info.
Create a new blog and join in the fun! Entries (RSS) and Comments (RSS). |