What's PHP and what does I need?

Source: Internet
Author: User
Tags php editor what php contact form

 

I explain what do you need to the start working with PHP.before doing so, I think it's ll be useful to explain what PHP are and how it works. PHP stands for php:hypertext preprocessor. It ' s a rather ugly name for a very powerful scripting language that's relatively easy to learn. You can use PHP in your websites for a wide range of tasks, such as processing online forms, uploading files.

When working with images, you can automatically generate thumbnails or watermarks.PHP can also read and write files directly on your server.And one of its most important uses are communicating with the database.Most of the time, PHP was used with the open source MySQL database. But it also works with all leading databases. there ' s much more so you can do with PHP. Introductory workshop, I ' m going to explain the basic structure of the language, and then show you how To process a contact form and e-mail its contents.

Once understand the basics of PHP, you'll find it a lot easier to expandyour knowledge and then apply them to a wide range of projects. Let's take a quick look at how PHP works. When someone visits a website, the browser sends a request to the Web server. With a static webpage This just consists of HTML, CSS images, and maybe JavaScript, the server simply responds by Sending all the necessary files.

However, if you use PHP in your webpages, the service sends the page to the PHPEngine for processing before sending, the response to the browser.And if a database is involved, the PHP engine was responsible for sending theRequest to database and processing the results.All the usually takes only a fraction of a second, so there ' s no noticeable delay. PHP is designed as an embedded language. What this means is, PHP code is often mixed or embedded in HTML markup. This is the HTML markup for a basic feedback form. And here, on lines and, is PHP commands that wrap around this paragraph. Here's the same Web form in a browser.

And as you can see, that's paragraph isn ' t displayed.But if I submit the form without filling in the of the fields, the paragraph isdisplayed along with other error messages. What's happened is, the PHP script have processed the form, discovered errors, and displayed all the messages ( C3>we can also use JS to does that). But take a look at the page ' s source code. there ' s no PHP in sight. It ' s just HTML. That's because PHP is a server-side technology.

The PHP code remains on the server and after it ' s been processed or parsed, itOutputs text and HTML. So, what does need to get started with PHP?First of all, you need a php-enabled Web server. Of course, your remote server, the one, the hosts your website, needs to support PHP. And you could use it for testing and development. But it's not a good idea. It ' s much better to set up a local testing environment. In the early days, you ' re likely to make mistakes.

So, working locally is both safer and quicker.You don ' t need to keep uploading your files every time for make a change.Even when you become more experienced, you'll appreciate being able to develop offline in Your local testing environment. you also need a Suitable Script Editor to write your PHP code. php is Written in plain the text like HTML and CSS. so, you don ' t Need anything special, but I'll offer some suggestions. for your local Testing environment, I recommend using XAMPP for Windows or MAMP on Mac OS x. Both provide you and the necessary components.

The Apache Web server, PHP, the MySQL database system, and a web based frontEnd for MySQL called PhpMyAdmin. By the the-the-by, Don ' is confused by the factThat's Apache is called a Web server.It's a piece of software that you installOn your local computer. You don ' t need a separate server computer.We won ' t is using MySQL or phpMyAdmin in this workshop.But they ' re useful to has installed for when you ' re ready to move onto the nextStage with PHP development. Separate videos show how to set up XAMPPand MAMP. However, you don ' t need to install themIf you already has a suitable PHP setup, such as, WAMP, easy PHP, or PHP runningOn IIS. Just Make sure so you ' re running PHP5.2 or later. Although, PHP is a plain text, I stronglyrecommend that's a script editor with the following features:a PHP syntax Checker to make it easy to spot m Istakes in your code, syntax coloring to highlight the different parts of the language, this also helps identify m Istakes, code hints to remind what you have to do with built in and custom functions, line numbering, and a feature to Identi FY matching opening and closing braces.

Here is some suggestions for script editors, that has all those features.Among the free offerings, PHP development tools, PDT, and Komodo Edit, is good.zend Studio and phped aren ' t free, but they ' re dedicated to working with PHP and are worth investigating if you plan to does a lot of PHP work. dreamweaver Isn ' t a dedicated PHP editor, but Dreamweaver CS5 and later have excellent support for PHP. And that's what I'll be using throughout this workshop. But it doesn ' t matter which editors your use.

The code you ' ll learn on these videos is the same. What's more , it ' s platform-neutral. The same code works on Windows, Mac OSX, and Linux.

What's PHP and what does I need?

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.