A PHP file may contain text, HTML tags and scripts. Scripts in a PHP file are executed on the server.
PHPÎļþ°üÀ¨£ºÎı¾¡¢HTML±êÇ©¡¢½Å±¾³ÌÐò¡£PHP½Å±¾³ÌÐòÊÇÔÚ·þÎñÆ÷¶ËÖ´Ðеġ£
What You Should Already Know
ÄãÓ¦¸ÃÒÑ¾ÕÆÎÕµÄÏà¹ØÖªÊ¶£º
Before you continue you should have a basic understanding of the following:
ÔÚÄã¼ÌÐøÏÂÃæµÄѧϰ֮ǰ£¬Äã±ØÐë¶ÔÏÂÃæµÄÓïÑÔÓÐÁË»ù±¾µÄÁ˽â
- HTML / XHTML
- Some scripting knowledge һЩ½Å±¾³ÌÐò
If you want to study these subjects first, find the tutorials on our Home page.
Èç¹ûÄãÏëÏÈѧϰÉÏÃæµÄ֪ʶ£¬Äã¿ÉÒÔ·ÃÎʽ̵̳ÄÊ×Ò³¡£
What is PHP?
ʲôÊÇPHP
- PHP stands for PHP: Hypertext Preprocessor
PHP±íʾPHP£º³¬Îı¾Óë´¦Àí³ÌÐò£¨Hypertext Preprocessor£©
- PHP is a server-side scripting language, like ASP
PHPÊÇ·þÎñÆ÷¶Ë½Å±¾³ÌÐòÖ´ÐÐÓïÑÔ£¬ÀàËÆÓÚASP
- PHP scripts are executed on the server
PHPµÄ½Å±¾³ÌÐòʵÔÚ·þÎñÆ÷¶ËÖ´ÐеÄ
- PHP supports many databases (MySQL, Informix, Oracle, Sybase, Solid, PostgreSQL, Generic ODBC, etc.)
PHPÖ§³ÖºÜ¶àµÄÊý¾Ý¿â£¨È磺MySQL, Informix, Oracle, Sybase, Solid, PostgreSQL, Generic ODBCµÈµÈ£©
- PHP is an open source software (OSS)
PHPÊÇÒ»ÖÖ¿ª·ÅʽԴ´úÂëÈí¼þ£¨OSS£©
- PHP is free to download and use
PHP¿ÉÒÔÃâ·ÑÏÂÔØºÍʹÓÃ
What is a PHP File?
ʲôÊÇPHPÎļþ£¿
- PHP files may contain text, HTML tags and scripts
PHPÎļþ°üÀ¨Îı¾¡¢HTML±êÇ©¡¢½Å±¾³ÌÐò
- PHP files are returned to the browser as plain HTML
PHPÎļþÊÇÒÔHTMLÊý¾ÝÁ÷µÄÐÎʽ·µ»Øä¯ÀÀÆ÷
- PHP files have a file extension of ".php", ".php3", or ".phtml"
PHPÎļþÓµÓÐÏÂÁеÄÀ©Õ¹Ãû£º".php", ".php3", or ".phtml"
What is MySQL?
ʲôÊÇMySQL£¿
- MySQL is a small database server
MySQLÊÇÒ»¸öСÐÍÊý¾Ý¿â
- MySQL is ideal for small and medium applications
MySQLÊÇΪСÐͺÍÖÐÐÍÓ¦ÓóÌÐò¶øÉè¼ÆµÄ
- MySQL supports standard SQL
MySQLÖ§³Ö±ê×¼µÄSQL
- MySQL compiles on a number of platforms
MySQLÖ§³Ö¶àƽ̨±à¼
- MySQL is free to download and use
MySQL¿ÉÒÔÃâ·ÑÏÂÔØÊ¹ÓÃ
PHP + MySQL
PHP ºÍ MySQL
- PHP combined with MySQL are cross-platform (means that you can develop in Windows and serve on a Unix platform)
PHPºÍMySQLÊÇÒ» ¸ö¿çƽ̨µÄ×éºÏ(ÕâÒâζ×ÅÄã¿ÉÒÔÔÚWindowsÏ¿ª·¢PHP³ÌÐòÈ»ºóÔÚUnix·þÎñÆ÷ÉÏÔËÐÐËü)
Why PHP?
PHPµÄÓÅÊÆ
- PHP runs on different platforms (Windows, Linux, Unix, etc.)
PHP¿ÉÒÔÔÚ²»Í¬µÄ²Ù×÷ƽ̨ÉÏʹÓã¨È磺Windows, Linux, UnixµÈµÈ£©
- PHP is compatible with almost all servers used today (Apache, IIS, etc.)
PHP¼¸ºõÓëËùÓеķþÎñÆ÷¼æÈÝ£¨È磺Apache¡¢IISµÈ£©
- PHP is FREE to download from the official PHP resource: www.php.net
PHP¿ÉÒÔ´ÓPHP¹Ù·½ÍøÕ¾ÉÏÃâ·ÑÏÂÔØ£ºhttp://www.php.net
- PHP is easy to learn and runs efficiently on the server side
PHPѧϰÆðÀ´·Ç³£¼òµ¥£¬²¢ÇÒÔÚ·þÎñÆ÷¶ËµÄÖ´ÐÐЧÂʺܸß
Where to Start?
ѧǰ׼±¸
- Install an Apache server on a Windows or Linux machine
ÔÚÄãµÄWindows»òLinuxÉϰ²×°Apache·þÎñÆ÷
- Install PHP on a Windows or Linux machine
ÔÚÄãµÄWindows»òLinuxÉϰ²×°PHP
- Install MySQL on a Windows or Linux machine
ÔÚÄãµÄWindows»òLinuxÉϰ²×°MySQL