100 likes | 223 Views
Dynamic Web site. With PHP and MySQL. MySQL. The combination of MySQL database and PHP scripting language is optimum for building dynamic websites. MySQL allows efficient storing of data which can be retrieved and served to browsers through PHP
E N D
Dynamic Web site With PHP and MySQL
MySQL • The combination of MySQL database and PHP scripting language is optimum for building dynamic websites. • MySQL allows efficient storing of data which can be retrieved and served to browsers through PHP • PHP provides ability to embed dynamic activity to web pages
Track changes to web site • Can be done through relational database such as MySQL, which is free, fast, and efficient • PHP is used to call MySQL through scripts to do tasks such as INSERT into a table, SELECT rows from a table, or JOIN tables on the fly • Also need a web server such as Apache web server to serve html and other types of files • MySQL, PHP, and Apache are the most common ingredients of open source technology for dynamic web content
Set up a development server (as opposed to production server) • Is required for easily and testing dynamic web sites • WAMP: “Windows, Apache, MySQL, PHP” • The Mac version is MAMP:”Mac, Apache, MySQL, PHP” • WAMP comes in a package, bundling the programs together
Install a WAMP on Windows • The free Zend Server CE is a good WAMP server (CE means Community Edition) • Can be downloaded from: • http://www.zend.com/en/products/server/ • Make sure to get it for you platform (e.g., Windows, Mac) • After downloading, run the installer, and go through the steps • Use the “Custom” option so that the MySQL server is installed • Under custom option make sure that both “phpMyAdmin” and “MySQL Sever”. Click “next” • In the next screen choose to install Apache web server (even if you have IIS web server. Click next. • Accept default values of 80 for the web server port and 10081 for the Zend server interface port. Click next. • Click install, then Finish. • After installation, your default browser will start, and agree with the terms • Follow through, select Developmen, and then select Password for admin and developer
Test the installation • Display the default home page (saved in the documen root of the server) by typing either of the following in the address bar of the browser: • http://localhost or http://127.0.0.1 • Localhost is the local computer which will also respond to the IP address: 127.0.0.1
Create the HelloWorld.htm file In Microsoft Notepad, type the following: <html> <head> <title> Testing </title> </head> <body> Hello World! </body> </html> • Save the file as helloWorld.htm(first make sure to switch from “Text documents (*.txt” to “All files, *.*”), and save it in the root directory • The root directory is at either of the following locations depending on your computer (32 bit or 64 bit): • C:\Program Files\Zend\Apache2\htdocs for 32 bit • C:\Program Files (x86)\Zend\Apache2\htdocs for 64 bit After the html file is saved in the root directory, you can call it in the browser by typing the following in the address bar of the browser: http://localhost/HelloWorld.htm or http://127.0.0.1/HelloWorld.htm This will run the html file, and display “Hello World” This means that now you have a successful installation and your WAMP is working properly! You are now ready to develop locally on your computer, with minimum delay (compared to using a remote server, such as a host server on the Web)
MySQL • MySQL database can be accessed either via • A command line • A web browser such as phpMyAdmin • A programming language such as PHP