First, let's take a look at something and use PHP and MySQL to build a database-driven website-

Source: Internet
Author: User
Abstract: In this article, we will solve the problems we will encounter when building a database-driven website. We only use two new tools, PHP and MySQL. If your Web host supports PHP/MySQL, you will save a lot of trouble. If this is not the case, you do not need to worry about it. we SyntaxHighlighter. all ();

Abstract: In this article, we will solve the problems we will encounter when building a database-driven website. We only use two new tools, PHP and MySQL. If your Web host supports PHP/MySQL, you will save a lot of trouble. If this is not the case, you don't have to worry about it. we will also learn how to install corresponding programs in Unix and Windows. This article is provided to senior web designers who may learn how to develop server programs. We will think that our readers are familiar with HTML, so we will not give any explanation when using HTML. In addition, we may also use a small amount of JavaScript in some places, but we will try to ensure that this is simple enough even for non-users. (14:10:35) caused By Wing, source: Linuxaid original: Kevin Yank translation: everywhere for today's Web, content is the most important. After you have mastered HTML and learned some tips about JavaScript and DHTML, you may now be able to design a beautiful website that can make people fall in love at first sight. The next step is to add some real information to the webpage. Many sites have to be updated constantly to successfully attract regular customers. In traditional website construction, this means that many HTML files are constantly updated. Now the problem arises. in more cases, the person who provides the content to the website is not the person who designs the webpage. The content provider does not even know HTML. Then how does the content provider add the content to the website? Not all companies have a full-time Webmaster, and it is a waste of time to make a Webmasters busy copying Word files to HTML templates all day long. It is really painful to protect a text-driven website. Many sites (including your sites ?) It is plagued by outdated information. To ensure normal information updates, you have to rewrite hundreds of HTML files. Server-side inclusion technology (SSI: HTML files, commands or pointers that can be called through the annotation line) may be slightly easier. But you still have to face hundreds of HTML files, even if you just want to make some basic changes to your site. To solve these headaches, design a database site. By completely separating the content and settings of your site, you can process one of them without affecting the other. You no longer need to write an HTML page for each piece of information. you only need to write an HTML page for a type of information. You no longer need to add new content to your page. all you have to do now is create a simple information management system, the author can add new content without using HTML. In this article, we will begin to solve the problems we will encounter when building a database-driven website. We only use two new tools, PHP and MySQL. If your Web host supports PHP/MySQL, you will save a lot of trouble. If this is not the case, you don't have to worry about it. we will also learn how to install corresponding programs in Unix and Windows. This article is provided to senior web designers who may learn how to develop server programs. We will think that our readers are familiar with HTML, so we will not give any explanation when using HTML. In addition, we may also use a small amount of JavaScript in some places, but we will try to ensure that this is simple enough even for non-users. After reading this article, you should have understood how to build a database-driven website, and you should have basically learned PHP and SQL. Most importantly, you will learn how to start building your own database-driven website. Chapter 1: installation preface first, thank you for reading this tutorial! In the next few months, I will take you over from the HTML and JavaScript world designed by the client. At present, text-driven websites are so successful, and what we need to learn here is to solve the maintenance problem. Before we start, we need to first understand the two tools required for our work. In Chapter 1, we will learn how to download and install the two software packages we will use: PHP and MySQL. PHP is a script language on the server. You can understand it as a "plug-in". with this "plug-in", your Web server can no longer just send a text Web page after receiving a browser request. After installing PHP, your Web server can read a new type of file (PHP script, the server can read real-time information from the database and add it to the Web page before responding to browser requests. PHP is completely free, and you can freely download and use it. To get information from a database, you first need to have a database. now we have to mention MySQL. MySQL is a relational database management system (RDBMS ). What role does it assume and how it works? we will explain it in detail below. Basically, it is a software package, which can organize and manage a large amount of data. MySQL also makes it easy for us to obtain information through server-side scripting languages such as PHP. Non-commercial applications of MySQL for Unix-based platforms (such as Linux) are free of charge. If you are lucky enough, your Web host may have installed MySQL and PHP for you. If this is the case, there are some chapters that do not work for you, you can jump directly to if your Web host provides PHP and MySQL. Most of the content we discussed in this tutorial applies to Windows-based or Unix-based servers. However, depending on the type of the server you are using, the installation process is different. The next section describes how to install it on a Windows-based Web server. Next, I will explain how to install it on Linux (and other Unix-based platforms. If you are not particularly interested in the installation process, you only need to read the appropriate section. In Windows, you can http://www.mysql.com/ (Or http://www.mysql.com/ Mirrors.html) and select Downloads for Windows MySQL related software> Downloads> Register and download policware version of mysql-win32. after the file is downloaded, decompress it and run setup.exe. After installation, MySQL is ready for use (excluding some of the configurations we will execute soon ). Like your Web service, MySQL is also a service that can run in the background, so it can respond to information requests at any time. You can find this service program in the bin subdirectory under the MySQL installation directory. If you are using a shared volume, this service is called mysqld-mongoware.exe. Before execution, change the name to mysqld.exe. At the MS-DOS prompt, run the following command to enable this service: C: mysqlin> mysqld to make sure this service is enabled when Windows is started, you need to create a shortcut, and add it to the startup program group. In addition, you can use this command to install C: mysqlin> mysqld-NT-install as a service in Windows nt/2000. if you have a problem running the shared version in Windows NT/2000, you can try to run this service in standalone mode: C: mysqlin> mysqld -- standalone. The next step is to install PHP. At the time of writing this tutorial, PHP 4.0 was basically mature. I have tried PHP 4.0-RC2 myself and have not encountered any problems. It is estimated that the final stable version will be released soon (we may not finish this tutorial). I suggest you install the latest version, so that you do not need to make any changes when the official version is released. PHP can http://www.php.net/ (Or http://www.php.net/ Download images from one of the mirror sites listed in mirrors. php for free. You need the "binaries for Win32" software package. You can get a good installation guide for PHP 3.0 for Windows from the following address: http://www.umesd.k12.or.us/php/win32install.html . When PHP 4.0 is released to the final version, you may need to upgrade it, but the 4.0 installation is basically the same as 3.0. You will not encounter any problems because of the different versions you select. After installing MySQL and PHP, you can enter the installation configuration. Install PHP and MySQL in RedHat Linux. If you are using different Linux versions or other Unix-based operating systems, these steps are very similar, even if they are not the same. As a RedHat Linux user, you may be interested in downloading and installing the RPM release of PHP and MySQL. RPM is indeed excellent, and it is very easy to install pre-packaged software. Unfortunately, they also limit how you choose to configure the software. For this reason, I think using the RPM version of PHP and MySQL brings more trouble than the actual value. Because some default RedHat Linux configurations will automatically install PHP for you, the first step is to delete the old versions of PHP and MySQL from your system. You need to log on as a super user to execute the following command. Note that in the following command, "%" indicates the shell prompt, which does not need to be entered. % Rpm-e mysql % rpm-e php do not worry if these two commands or one of the display programs is not installed. If the second command is successfully executed (that is, no information is displayed), it proves that the old version of PHP is installed and you must delete it completely. Open the Apache configuration file (usually/etc/httpd/conf/httpd. conf) in the text editor you are used to and find the following two lines. These two lines are usually divided into different parts of the file, so if these two lines are not the same, there is nothing to worry about. LoadModule php3_module modules/libphp3.so AddModule mod_php3.c is used to tell Apache to load PHP as the plug-in module. When you uninstall this module, you also need to delete the two lines to ensure that Apache works normally. You can add (#) at the beginning of the two lines to make them comments. To ensure that Apache is still working normally, you must restart it without the PHP plug-in: %/etc/rc. d/init. d/httpd stop %/etc/rc. d/init. d/httpd start after everything is arranged, you can prepare to download and install MySQL and PHP. Installing MySQL for Linux in Linux is free of charge. http://www.mysql.com/ (Or http://www.mysql.com/ Downloads/mirrors.html) Download the final stable version (listed in "recommended" on the download page ). You should obtain the "tarball source downloadparts" File name: mysql-version.tar.gz. After downloading the file, you must log on as a super user to install MySQL, unless you only want to install MySQL in your own home directory. Start to unbind the downloaded file and enter the newly created directory: % tar xfz mysql-version.tar.gz % cd mysql-version below you need to configure MySQL installation. Unless you are absolutely sure, you need to specify the installation directory. I recommend/usr/local/mysql: %. /configure -- prefix =/usr/local/mysql after detecting the display and display configurations, you will eventually return to the command prompt. Now you can compile MySQL: % make after compilation, you will return to the command prompt again. Now you can install your new program: % make install now MySQL has been installed,

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.