PHP Beginner – Create a Random Text Generator

Overview:

When creating a website, it is often necessary to display dynamic text on the page. This text will change every time the page is loaded.

To create this solution, a database could be used. There is however another solution, it uses PHP’s built in rand() function and an array().

PHP Functions

PHP has hundreds of functions to make programming easier and more efficient. A PHP function is a built in piece of code that when called, performs a specific ‘function’, or routine, and then returns the result.

For example, the strlen() function takes in a string (a series of characters), and returns the length or how many characters that string contained. Here is how it works:


$myString = “The long day is now over!”;

// create a variable to store the length of the string

$stringLength;

// call the function, and pass the string to it

$stringLength = strlen($myString);

// send out the length of the string to the screen

echo $stringLength;

?>

The Output would be ’24’, because there are 24 characters in that string (include the white space character).

Rand() Function

PHP has a built in function that will generate a random number between a range. To use it, put a starting number in the first parameter location, and the end number in the second parameter location. This will create a range.

For Example:


rand(1,3);

This would generate one number each time, and it could be either 1, 2 or 3.

PHP Array

When using PHP, an array can be used to store any kind of data (strings, numbers, objects, arrays, booleans). We will use an array to store text (a string).

Arrays store information using a KEY – VALUE notation. The Key is the location of our stored text in the array. The Value is the actual text we plan to store. Here is how it looks.


$myStorageArray[KEY] = VALUE;

The KEY is a whole number, like a 1, 200, or 342. The VALUE is a string (a string is a series of characters wrapped inside single or double quotes). So the correct usage would look like this:


$myStorageArray[1] = ‘I am six feet tall’;

$myStorageArray[2] = ‘My hair color is brown’;

Do you see how it works. Put a unique number in the KEY, and set it’s VALUE to whatever text you want to store. The key is the location, and we will use it later to pull the data (VALUE) back out to print it to the screen.

Random Text Generator

Putting it all together, we will use rand() and array(). Rand() will generate a dynamic number and the array will store our data that we will retrieve dynamically.

Our task is then a simple matter of using the random number as a KEY to see the VALUE of the array. Here is the full code.

// store my quotes

$myQuotes[0] = ‘he who works, will achieve something – we hope!’;

$myQuotes[1] = ‘the early bird gets the worm, or something else with dirt’;

$myQuotes[2] = ‘that which does not kill me, hurts a lot’;

// get a random number (0,1,2)

$randomNumber = rand(0,2);

// output the value of my array based on the random number

echo $myQuotes[$randomNumber];

?>

The $myQuotes array stores 3 of my favorite ‘modified’ quotes. The $randomNumber variable will contain a 0, 1, 2, and is used as a $randomNumber variable and placed in the KEY of the $myQuotes array. To make sure this will work, choose consecutive numbers – 1,2,3 or 4001, 4002, 4003, etc.

Every time the page is loaded, the echo statement sends one of the 3 quotes to the screen.

Conclusion

Using only simple PHP tools, you are able to quickly create a dynamic text generator using only rand(), echo, and an array. A simple, but very powerful PHP trick. The array can have as many KEY-VALUES as you want, just remember to increase the size of the random number range to see all of your values.



Source by Paul Markovich

Freelance Writers: Ditch Queries, Cranky Editors & the Starving Freelancer Existence

For freelance writers (and other creative professionals) to ditch queries, cranky editors and the starving freelancer existence, they must first change their mindset. To accomplish this, their mission needs to be ditching the notion of depending on the whim of large publications and / or companies to make a living .

I've conversed with many freelancers about the number of large, national publications / companies that want quality writing, design, artwork, etc. for their publications, but take months to answer questions, make freelancers wait even more months to be paid, pay paltry for the assignments to begin with, cancel gigs for no reason at all and treat freelancers little better than unnecessary cogs in their money-making wheel.

Freelancing is extremely competitive. Here, freelancers (writers, editors, web designers, illustrators, etc.) need to think beyond traditional outlets for getting work. This way, they become less dependent on the "majors" (eg, national magazines, blue-chip companies) for their living. There are so many ways for freelancers to use their editorial and / or creative skills that they do not have to turn their power over to any one company or publication.

Below are some of the more nontraditional ways that I've written about to make money if you are an editorial and / or creative professional. Eg:

Start a Virtual Assistant's Business

Niche Writing for Business Professionals

Start a Joke Site

Create Online Educational Seminars

Scriptwriting

The list is endless. So, instead of composing a query and waiting months just to hear if you got the assignment – much less how long you are going to have to wait to get paid for it – QUERY YOURSELF about how you can make freelancing a profitable way of life, not a starving existence. Happy writing (editing, designing, illustrating, etc.)



Source by Yuwanda Black

What In The World Is Forex Training?

Forex trading is an abbreviation for Foreign Exchange Trading. At times, it is also known as “FX” however that particular nickname frequently gets people confused, because FX is also shorthand for “special effects”. It is also the name of a cable channel. With the introduction of the Internet Forex trading has exploded in popularity. You would be unable to do forex trading without Internet access.

What Is an Over-The-Counter Market?

One of the benefits of educating yourself in Forex training that you do not have to do it through a broker. You have the ability to accomplish this yourself via the almighty Internet. Because of this reason, professional stockbrokers as well as the business press frequently refer to any stock play that you can accomplish yourself as “over-the-counter markets”, or OTC markets.

This is a not so subtle tongue in cheek type of nickname as a comparison of Forex to over-the-counter medication in place of the frequently more powerful medication that you would need a prescription for from a doctor.

So, What Is It, Already?

In terms of Forex training, what you do is download a program so you can learn Forex trading. You would do everything that you would normally do in Forex trading, only you would not be using any of your real money.

It is best if you take at least two months of educating yourself in Forex training software prior to you putting any type of real money into it. Nevertheless, not everybody has the ability to get rich, or even break even for that matter, with the regular stock market, much less Forex trading.

You can get Forex training software packages that are free from various Forex websites who are in the hopes of getting your business eventually. They are sort of like free samples that you would get at a cosmetic store. They would rather give you a period of game trading and are more than willing to lose some of the short-term profit so that they can reach the long-term financial goals with getting repeat types of customers.

Additional Advantages

Other benefits are that you will not have any commissions to pay, the brokers typically make their money on the spreads and there is a consistent flow of people who wish to trade, as everybody wants money.

The odds for the average individual to make money are typically higher with Forex trading then with the traditional stock market. You also have incredible leverage you can employ in your trades (also known as gearing).

There is quite a bit more to Forex training than the actual scope of this article can furnish. However understand that Forex training is not a surefire method of making money. It is also not a simple or easy way of making money, there is a lot of education as well as gambling involved. Over 50% of Forex trading is speculative in nature, which actually means, taking a gamble.



Source by Korbin Newlyn

Forex Trading Strategy That Works?

Here is a great Forex trading strategy that works very well for me. No it’s not the regular advice that you get everyday from other traders that are probably losing their money in the market too. Most people will advice you to read all the books about Forex, take all the courses out there, practice for 5 years then see where will that take you. We know that this is non-sense.

When we decided to invest in the Forex market it was because we want to invest money and see some returns quickly without having to go through a learning curve that takes forever, then if you got really lucky it might work for you.

I decided to take a different approach and think a little bit out of the box. I figured, I don’t have to be an expert in Forex to make money in that market. Let me give you an example. If someone filed a lawsuit against you, You don’t have to study law for 10 years so you can win in court! You simply hire a lawyer that knows what he’s doing to take care of that for you.

It’s the same thing here, I am an investor I need to make money investing in Forex. There is no point in studying it for years and try to come up with strategies that only god knows if it will ever work or not. I even end up spending money on training courses and I find my self in the end losing money without even getting started in trading.

I took a different path, some might call it laziness but I frankly don’t care. All I care about is to see returns on my investment without learning how to trade from scratch for years. I invest my time looking for qualified traders that have a track record and the skills to increase my portfolio safely every day. There are traders all over the world with outstanding trading skills there is nothing wrong with hiring or following some of them and in return they take a small cut, at the end of the day everybody is happy.

It’s not an easy task to find a good trader with the skills needed to trade your money, But it sure is much easier for me than trying to learn all about Forex for years and even spend tons of money on courses and EAs. Let me tell you the key features that I look for in a trader. There are 7 key features makes a trader qualified to trade my account and I am going to share them with you.

The 7 Key Features/Skills That Makes a Trader Qualified To Trade For Me:

  1. Risk shouldn’t be more than 3% of the account in a single trade.
  2. A track record and history of live trading on a live account for at least 1 year.
  3. Risk:Reward ratio 1:1, I prefer 1:2 meaning profit should be double the risk.
  4. Open positions shouldn’t be more than 3 at any given time.
  5. No Scalping! I don’t go for 3-5 pips in profit per trade that doesn’t work.
  6. There should be always a “stop loss” and a “take profit” target in place.
  7. SL targets should never be bigger than the TP targets.

Take the time to check online traders, and I mean real traders not robots. Make sure they have the above skills, study their history carefully and start partnering up with them. Trade a small amount of your capital and as you get comfortable increase your trading balance a bit by bit. This is a very realistic approach, and it works. I advise you to cut your losses today stop spending money on courses/trainers and look for real traders that can actually trade and help you grow your portfolio.



Source by Mohamed Rabea

At Home Money

We all want more at home money, meaning money you can make from home in your spare time. No matter how much a person might make, when it comes to income we want more! Why is this – because it is what we need to get our basic needs? If you don’t have a means to earn it then you can’t get more basic things, it’s that simple.

And now in this reality we are facing in this world today we simply need more than one way to earn this money. Having a plan B these days is a must! Not just a passing thought as when times were better. Earning at home money is something that can be done in spare time. But also should be something you truly enjoy. So in order to have this you must consider certain things.

a. Provide a service in return for money working from your home.

b. Have a product to provide in return for money made from your home.

It must be understood that this will be your at home money making business, so you control the time spent making it work for you.

In the first instance persons must come to your home so you can provide the service they wish to receive, this can interfere with time spent with family, and you are not able to leverage other persons to help it grow. You only receive the at home money when you provide this service.

In the second instance you have a product that others want and need and will buy, you also will have the ability to leverage others to share this product and bring at home money by leveraging them sharing the product as well. And at the same time they are also introduced by you how to earn as well.

This will allow unlimited at home money earning potential and also free up even more time for you as time passes yet your at home money business continues to grow. This is the plan I recommend!

Now that you have this knowledge how will you use it?



Source by Todd Sinnard

Money, Money, Money!

One of the paradoxes of abundant cash flow is that the more you ‘need’ money, the less it graces your world. The more you focus on money as your outcome, the less that money manifests in your world. That’s because something is seriously flawed with this model of abundance.

Let’s say you want to have a six-figure income. You do the work to create awareness around your limiting beliefs, you invest your energy in clearing the patterns, set your intentions, practice visualizations, take action, take action, etc. What you may not realize, is that you are literally creating separation between you and your source of abundance by focusing on what is missing in your world.

When you ask for what you want, when you express a need, you are highlighting a state of lack in your world. You are shouting from the mountain tops that you are not enough. This won’t flip your abundance switch on!

Here’s the thing, chances are it’s not about the bucks! Most often what you really want is what you ‘think’ money will give you… security, freedom, influence, etc. At an even deeper level what you probably want even more is to do what makes you come alive. So, why focus on the money, when what you really want is a life of meaning.

“Whether you are consciously aware of it or not, deep inside you are seeking growth and aliveness, wanting to manifest your potential and be all you can be.” ~Sanaya Roman & Duane Packer

If you’d like to have more money so that you can have more freedom in your world, try creating more freedom in your life and notice how abundance flows your way. Here’s the shift I’m inviting you to explore: engage money as a tool to help you more fully express yourself and your potential, not as something you need to fill a ‘less than’ experience.

Let’s explore how to bring this into being in your world. Grab a pad and pen and let’s dive in:

1. What is the one thing – that if you had it right now – would totally flip your world?

2. Think of three ways that you can have the essence of that right now.

3. Jot down the qualities that would support you in bringing those things into being right now. Who would you become if you expressed those qualities on a daily basis? Imagine yourself as that fully expressed being and feel what it would be like to be that ‘you.’

4. Spend 90% of your energy focusing on the joy of having what IS already abundant in your world. Bring the qualities of your being that liven you into play as much as possible.

Your ability to experience abundance in your world is directly related to your willingness to embody possibility and aliveness on a moment by moment basis. Choose expansive experiences and abundance will saturate your world. It’s inevitable!



Source by Adela Rubio

Making Money – Get Paid to Refer

Sounds simple, making money by getting paid to refer, but is it really possible to make money by just referring people. Well the simple answer is yes you can. I came across this about 18 months ago and have been slowly but steadily seeing my earnings from it grow.

We all actually play a part in this chain. I’ll give you an example:

Not so long ago I was spending a lot of time on Twitter and Facebook seeing what my buddies were up to, when one of them mentioned that they managed all their social profiles as well as all their email addresses in one easy desktop application called Digsby. I thought that was a pretty smart idea so I downloaded the free software and now use Digsby for handling all my social networking accounts.

Now even though I didn’t have to pay for Digsby my buddy who referred me was able to make money by referring me, so he was ‘paid to refer’, and there are 1000’s of really useful software tools like that you can get paid from for refereeing. Also there is a digital information warehouse that you can join for free, make money get paid to refer any of the 10’000’s of the products and services that you refer of theirs. People can download whatever they buy straight way and you get paid money for referring them straight away too.

I know people who make 1000’s a month getting paid to refer, and the ones that don’t are the ones who think they are there to sell, selling doesn’t work it’s as simple as finding a group of people really eager for a solution say one on “how to train Labrador puppies” and then referring the to a digital product at ClickBank to solve their problems, it’s a win win situation.

The best place to learn how to ‘make money getting paid to refer’ is from the someone who does it every day, well the people who do it every day are called affiliate marketers.

Affiliate marketers get paid a commission on everything they refer and it doesn’t stop with digital downloadable products either, you can take a look at company’s like Commission Junction, Linkshare or even Amazon just to name a few, and make money getting paid to refer tangible goods of all kinds, it really just depends on what your into.



Source by Anthony Balthazar

Forex Foreign Exchange Broker – Do You Need It?

A Forex Foreign Exchange Broker is really an important aspect of any want to-be professional trader. If you have a demo account, you do not feel the real currency pressure of the foreign exchange market. Because of this you need something more real. Pressure is the scene of the currency exchange market. We need to understand that a demo account is not what we really need at Forex to know the market. It is easy and quick, but we must focus on the long term profits.

When you open a demo account using a Forex Foreign Exchange Broker you must know one thing. This is good if you are a beginner and you need to know the basics of the Forex trading. One of the most important advantages of having a Forex broker is that they can offer you a protected account. See them as the bridge between the full Forex account and the demo account to learn Forex. These are the key features: 1) if you lose, then the broker will covers it. We think this is the best part of the protected account. Also if you make any profits they are yours. Really good stuff. You can start with a small balance if you need to. You just need to trade a set leverage.

You can make money here if you know how to invest. With all the features we mentioned about, you have many advantages: you have low risk, if you make any profits you can keep them, and you will get a lot of practice. This account will give you a greater change to succeed in the foreign exchange market than the change you have with a demo account. I you need to learn the basics of Forex you are better off using a demo account.



Source by Ramon Nunez

Webmail Vs Desktop Email Clients

Ever since the invention of email was brought forth into the world, the age old question has persisted: webmail or desktop? The Internet caught fire in 1997, and at that time, Hotmail was the major player on the webmail scene. From a business perspective, having a Hotmail address wasn’t exactly a sign of being established. Most business people clung to their desktop account for dear life, thinking that a non-Hotmail address was instant credibility. But over the years there has been a significant change in that thought pattern. It is now possible to maintain a webmail account without using a generic name that calls reputation into question. In order to know if it is right for you, however, you must first weigh the pros and the cons of these two very popular forms of communication.

Accessibility: Webmail bears the advantage of being accessible at any place and time no matter if you have your computer with you or not. For today’s business person this makes the email form preferable to desktop email because it allows them to take care of pressing matters more easily. Instead of lugging around a laptop, you can simply duck in to an Internet cafe, take care of what you need to, and then go on about your business. When confined to the desktop, matters must wait until you are able to make it back to the home office.

Installation: With desktop mail, you will have to download a program to your computer. Doing so means that hard drive space is consumed. Add in messages and attachments, and storage capacity shrinks. This may not be a big deal if you don’t use the computer for entertainment purposes. However, if you like to keep music downloads and movies at the ready, that can eat away at the available room. Webmail is maintained online. That means no matter how large an email is, it’s maintained at a site other than your home computer, allowing greater flexibility in the files that you keep.

Usage: One drawback of Webmail is that you may sometimes need to use it when there is maintenance going on or the service is experiencing technical issues. When this happens, you’re out of luck, no matter if you have a viable Internet connection or not. Desktop emails can be viewed online (including non-web hosted attachments). If you deal in TIFFs, Word docs, and PDF files, this can be highly advantageous.

However, when you experience Internet connection problems, you’re out of luck in both cases. Transferring data like emails and attachments requires a constant use of the Internet. And desktop email programs can still be subject to tech issues. With webmail, assigned pros are working to fix issues. Desktop email puts the burden on you.



Source by Darren W Chow

Employ Freelancers For Small Jobs

Small job employment can involve all sorts of activities, such as surfing, texting, commenting on blogs or YouTube videos, joining Facebook groups or becoming a Twitter follower. These are the sort of thing that anybody can do, but can’t be done by just one person. An employer typically enlists the help of a large number of people to help boost the popularity of something that he or she is trying to promote, such as a YouTube video or a blog. Comments on sites such as these get picked up by the search engines and help lead surfers to the site.

Small job employment can also involve work that requires a little more skill on the worker’s part, such as writing, graphic design or web programming. Anyone who has marketable skills such as these and a computer can earn money online through small job employment. In today’s uncertain economy, no job is secure, and many skilled workers have found themselves without employment due to corporate downsizing. Instead of pounding the pavement looking for another job or settling for something that’s beneath their skill level, some people have opted to stay at home and work online. Many mothers have found that working online from home lets them spend time with their children and avoid the high cost of child care. It’s also a great way for young people to earn a little extra cash, especially if they are having trouble getting into the work force.

The small jobs that one can get through freelance work may not pay much, but the whole point of small job employment is to get paid to do something that takes very little time and effort. It is possible to earn a fairly lucrative income this way if you do a lot of these small jobs, and there is no limit to the number of small jobs that are available. There are thousands of them available online, and new ones are being created constantly as webmasters continue to promote their sites.

For employers, the Internet is the solution to finding inexpensive labor to do simple things that really don’t warrant hiring people and putting them on a payroll. They can simply find willing participants, instruct them in what to do and then issue payment online. There are several excellent sites on the Internet that bring employers and workers together for all sorts of tasks. The site acts as an agent, taking a small percentage for the service and often payment can even be arranged through the site in the interest of security for both parties. So, if you have small jobs that need to be done, help is literally at your fingertips!



Source by Mariya Wordsworth