|
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.
Do You Want To Create A Website Or A Business Online?
This is a question you will have to address. Many folks just a build a website but do not think out why they are really doing it. As a result they don't take it seriously and therefore they do not get serious results. This makes logical sense right? A website in and of itself means nothing unless it has visitors and achieves a certain objective. So you have to be clear what you want to achieve as this will help you focus on your research and build a site that can achieve your objective. Quality research will help you build a quality website. To build a business online you are going to have to build a relationship with your site visitors. You will need to show them how to connect the dots and you can only do this by providing valuable content that is benefit driven. Furthermore you are going to have to show them solid evidence of how your product or service can help them achieve results. Connecting the dots means moving them closer to their outcome. Once they can follow this and see how it will work for them you will naturally build credibility which will result in you having a profitable website. As mentioned when you build your site you want to clearly have your visitor's objectives in mind so that you can address their concerns and overcome their objections. If you can help them achieve their goals it will be a win win situation for all parties concerned.
Create A Real Website That Will Work For You
The key element to your success is you. It is what you do today that will determine whether you succeed or fail. Beyond that it comes down to consistency. It's what you do every day that will bring results. Sporadic efforts here and there will not yield success long term. So your first objective is to figure out what you are going to build a site around. Write down your interests and various topics that may be relative to those interests. Once you have a list then its time to start researching. The key to effective research is focus. Focus can be achieved by understanding what your objectives are and what can help you achieve those objectives. As you know you need traffic to your site to have any hope of making money. No traffic means no money. So you will need to research markets that have a high level of activity online. The ideal scenario is to find keywords that get searched a lot and have little competition. With that said you have to be careful. Competition in actual fact is good because it means that there is money to be made in that market. So what you need to do is find ways to enter the market using less competitive keywords yet still be able to generate income relative to the main keyword. For example with weight loss there are many ways to enter that market without going after the main keyword. Example; lose belly fat, or lose weight by eating healthy foods and so on. I think you get the idea. Once you have the keywords that you can compete with you will then need to build your site using each keyword to build a page around. You will need to structure your web pages so that you get the right keyword density. To conclude there are lots of site builders out there to help you with this. The one I had the most success with was site build it. They cover all of the above and also take care of the hosting. This way all you have to do is engage in your passion.
|
* 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). |