today herbal health

just another regularban.info web blog

MEMBERS:

Using Functions

Functions are used to perform a well defined task that is normally repeated at various places within a web site, web application, or other software application. The function sometimes needs certain information before performing its task, and sometimes returns a value to the calling page or program.

An example of how to use a simple function in PHP:

 function showMessage() {

echo "{$_SESSION["message"]}"; }

The above example shows a very simple function that displays the contents of a session variable called 'message'. The idea being that while a user is using a web site, etc, various messages are generated and stored in the 'message' session variable. Whenever the showMessage function is called, the contents of the session variable are displayed. So, for example, when the user logs on, you could display a message saying that they have done so. Likewise, when they log off, a different message could be displayed.

Calling a function

To call the showMessage function, you would just need to include the line:

showMessage()

in the web page (wrapped in php tags to distinguish it from normall HTML).

Passing values to a function

Often, a function requires one or more input values in order to perform its task. For example, take the following example that takes two numbers as input, and adds them together. The result is then returned to the calling web page or program.

function addNumbers($number1,$number2) {

$answer = $number1 + $number2;

return $answer; }

In the calling program we would have something similar to the following:

$number1 = "5";
$number2 = "6";
$sumOfNumbers = addNumbers($number1,$number2);
echo "$sumOfNumbers";

Obviously, in a real program you would not have the numbers hardcoded like this, but they would be obtained from user input or by some other means. Notice also that although the name of the returned variable is $answer, the calling program makes no reference to that. We could, if we wanted to, change the calling program to:

$answer = addNumbers($number1,$number2);
echo "$answer";

which might make things slightly easier to understand.

About the Author: John Dixon is a web developer working for My Health Questions Matter, a company that helps users of the health service to ask the right questions when discussing their medical condition with health professionals. John is also interested in computer history, and maintains http://www.computernostalgia.net, a site dedicated to the history of the computer. John also provides web development services to large and small clients via his own company John Dixon Technology Limited.

 


A Primer On Automatic Website Builder

In the recent past, the Internet has become the prime means of media connection around the world. Aside from providing a fast and inexpensive means of imparting and extracting information, cyberspace has also redefined the very lifestyle of people around the world. From shopping to taking up courses, people have found immeasurable uses for the Internet.

No wonder then that everyone wants a space in cyber world. A website is the means of publishing personal or corporate information over the Internet. It is like a unique telephone number over a vast circuit of telephone lines; or better put, a unique address in the wide world of cyber space.

However, it is a well-known fact that not everybody knows how to create a website. A vast majority of Internet users who would like their very own web address in cyberspace do not have either the skills or the time to learn the intricacies of creating a website.

This is where an awb comes in handy. As the name indicates, an automatic website builder is an application or a group of applications that lets an individual who has no knowledge of underlying website software applications and languages involved build a website without sweat.

Unlike an HTML editor which merely facilitates in the creation of correct HTML scripts, an automatic builder provides the user with web page templates that are already built and can be modified by the user according to his or her preferences. Aside from pre-fabricated templates, some awb provide other important features as well. A number of automatic website builders have Shipping Cart feature that enables web visitors to shop for goods offered at the website. Still, other programs have built-in survey counters that can monitor the traffic of users who visited the website.

An automatic builder makes the process of putting the latest and most relevant information or content in a user's website quick and easy. Having the freshest content in a website means satisfied web visitors. This translates to higher traffic; therefore, improving a website's list ranking in search engines like Google.

Some websites come with a price. The range of prices may be as wide as a few bucks per month for subscription setting to more than a hundred dollars for one-time purchase arrangements. Others can be availed for free.

A purchased website builder provides premium features than a free program. A purchased program can come with unlimited number of website designs which could easily be a means to make money. By creating unique websites for friends and other customers, a user can easily earn additional income. Plus, this type of builder has tie-ups with other certified applications that can be enjoyed for free.

A free application, like the one commonly used for blog websites, has a limited number of website design concepts. There is a high probability that using this type of builder will be prone to pop-ups and third party piggyback advertisements. However, while the uniqueness or even the security of a website may be compromised, a free automatic website builder has zero cost.

Automatic website builders can be classified into to basic types; online and offline. An online builder enables users to edit the website they created using a web browser like Internet Explorer or Netscape. While an offline builder requires users to edit the site in a computer's local application before the edited website can be published. But no matter what type of automatic website builder application is used, the user is sure to have an efficient, effective and a fun way of building websites.

For more internet marketing tips and strategies be sure to follow the link in the resource box below:

Daegan Smith is an Expert Internet Network Marketer. "Learn
How To Make $10,717 In Less Than a Week While Quickly And
Easily EXPLODING Your Network Marketing Organization Without
EVER Buying a Single Lead?"
==> http://www.easymlmprofits.com
==> MLM Success Secrets

Daegan Smith - EzineArticles Expert Author

 


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.

About the Author: John Dixon is a web developer working for http://www.MyQuestionsMatter, a company that helps users of the health service to ask the right questions in their dealings with health professionals. John is also interested in computer history, and maintains http://www.computernostalgia.net, a site dedicated to the history of the computer. John also provides web development services to large and small clients via his own company John Dixon Technology Limited.

 


Pages 
* About

Archives
    * February 2008
    * January 2008

Categories:
* Uncategorized

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).