When you started reading this sentence you assumed lo acabaría en inglés. However, I didn't finish in English. This begs the question, 'In which language did I finish?' Unless I tell you the language, you'd have to run around and compare the words against known words in order to learn that it was Spanish, but I'd bet you'd give up and move on first. Servers work much the same way; if you don't let it know the language it assumes you're speaking to someone else (the browser) and sends it along. Servers aren't even friendly enough to give it a whack and see how it comes out.
So, what's server-speak for "Here comes PHP!"? Well, it definitely looks foreign:
Sure. Whatever. It's no use telling the server you're speaking PHP because you only know how to say "I speak PHP". What's that going to do for you? Well, imagine you were visiting a scripts site and wondering how you could put today's date on your webpage when you come across the following little snippet:
To display the date on your webpage, find the area you want to put the date then insert the code below.
echo date('m/d/Y');
Now, you're equipped with 2 statements: "I'm going to be speaking PHP" and "Today's date is mm/dd/YYYY". You then edit the file you want to put the date in by inserting this code in the desired location: Put the file back on the server and you're date shows up exactly as the snippet said it would. Or does it?
If you got lucky, it showed up. If not, there's a little more to learn. There's actually more than one way to tell the server that PHP is coming and I've only covered one way - the other ways aren't necessary for you to know in order to use PHP on your site. Most servers require a bit more information first - they want the name of the file to say whether PHP is there or not. To tell the server that PHP is inside the file, you need to change the extension (the part after the dot) to php. Uh, sure, the extension. Does this guy speak English? YEP! lol. If that wasn't clear, let's illustrate by assuming your file was called index.html when you downloaded it to edit. Before you upload that file back to the server, you need to change "html" to "php", so that the file is called index.php. Without that change most servers won't even look for PHP. The nice thing is that even if a file ends in "php", the server still looks for those opening pieces saying "Here comes PHP!" before trying to read what follows in PHP and just sends everything back to the browser which is outside of PHP, so you don't hurt anything!
Tired of reading? Me too! And, we can only do a couple of things! Or can we? There are a lot of scripts out there which require you to copy and paste a little code here and there or to include a file. In those cases, you are now leaps and bounds ahead in getting them to work!
Jeremy Miller - Webmaster of Script Reference - The *NEW* PHP Reference & Tutorial Site For Non-Programmers
Many millions of dollars are being wasted on promoting and... Read More
An accessible Web site is easily approached, easily understood, and... Read More
Even with the steady growth of the World Wide Web,... Read More
Many web developers today are starting to KISS their website,... Read More
Before you set up any scripts you will need some... Read More
Anyone who knows anything about web accessibility knows that images... Read More
The popular search engine Google indexes over 8 billion websites.... Read More
Alternate medicine finds its own place in the hearts and... Read More
Have you ever wondered what challenges are faced by other... Read More
There's been widespread speculation about the new legislation being introduced... Read More
Although designing a great web site is an important part... Read More
We are clearly well past the innocent "golden age" of... Read More
When building a relationship, listening is more important than talking.A... Read More
RIVERSIDE, CA August 4, 2004 ?- "Historically, small business owners... Read More
Creatively marketing your corporate site takes time in the set... Read More
You hear a great deal about the Internet these days... Read More
There are lots of HTML editors on the market, however,... Read More
If you are developing your website on a host that... Read More
If you don't have a web site yet, are thinking... Read More
That's right. According to a recent study by Nielsen/NetRatings, Amazon.com... Read More
When most people build a web site, they think one... Read More
This simple question can take on several different forms, but... Read More
How many Web Sites did you stumble over telling you... Read More
"If you build it, they will come"; is an age... Read More
Simply ensuring your website is accessible to screen reader users... Read More
Better Web Site ROIHow to increase your business profitability by... Read More
Whether you have your own business already, or are looking... Read More
Profiles are one of the best kept secrets around regarding... Read More
Your site is getting traffic, but conversion rates are horrible.... Read More
D.zigns dzignerwebs The Basics Before starting on... Read More
Thinking about starting up a business? The web is the... Read More
You don't believe in astrology but you check your horoscope... Read More
So what do you do if need to get a... Read More
Yahoo has long offered email, an online calendar, notes, bookmarks,... Read More
#5 User Satisfaction: Learn what your visitors and site users... Read More
Many small businesses have the misconception that their business can... Read More
Globalize Your WebsiteThe Internet has unlocked a wide array of... Read More
Here's something you may never have thought of before:If I... Read More
See how you can create graphic effects on text with... Read More
When web content gets discussed on webmaster bulletin boards, the... Read More
After planning the design and content of your website, it's... Read More
Most interactive websites nowadays require data to be presented dynamically... Read More
That's right. According to a recent study by Nielsen/NetRatings, Amazon.com... Read More
Revenues are often lost because many business owners don't see... Read More
We are clearly well past the innocent "golden age" of... Read More
2 Golden Rules for an Engaging Website35% of visitors fail... Read More
Do you need a web site? Are you considering getting... Read More
I'm a freelance programmer and somehow I managed to get... Read More
When most people build a web site, they think one... Read More
Web templates by nature are created to aid and ease... Read More
"I am a writer, not a business-person. I don't want... Read More
When I started my company in 2002, I knew I... Read More
If your company own one or more stores, you might... Read More
From early days of www, the Internet sites that are... Read More
More and more businesses are recognizing the importance of content... Read More
Webmasters deal with a myriad of complex design challenges every... Read More
Are bloated images slowing down your web site and causing... Read More
While most marketers are beginning to understand the critical importance... Read More
How many Web Sites did you stumble over telling you... Read More
If you like the Internet and surfing through the billions... Read More
The needs of screen magnifier users are overlooked when implementing... Read More
Dance is how you pamper your soul and satiate your... Read More
Writing for the web is totally different to writing for... Read More
What do you mean, you don't have a website for... Read More
There was a time not long ago when setting up... Read More
Today it seems everyone is jumping on the entrepreneur bandwagon,... Read More
Web Development |