Create dynamic sites with PHP & MySQL
|
|
|
- Gary Sims
- 10 years ago
- Views:
Transcription
1 Create dynamic sites with PHP & MySQL Presented by developerworks, your source for great tutorials Table of Contents If you're viewing this document online, you can click any of the topics below to link directly to that section. 1. About this tutorial 2 2. Introduction and installation 3 3. Start coding 7 4. Add new records Get a better view Delete, edit, and search data Next steps: tips and resources 20 Create dynamic sites with PHP & MySQL Page 1
2 Section 1. About this tutorial Should I take this tutorial? This tutorial shows you how to use two open source, cross-platform tools for creating a dynamic Web site: PHP and MySQL. When we are finished, you will know how dynamic sites work and how they serve the content, and you will be ready to serve your own dynamic content from your site. About the author For technical questions about the content of this tutorial, contact the author, Md. Ashraful Anam, at [email protected]. Md. Ashraful Anam works as an independent Web developer. Having conquered the Windows platform, he recently changed his interest to Linux and immediately fell in love with it. In his spare time he can be seen wandering the virtual avenues of the net, testing open source software, and trying to promote his country, Bangladesh, in the international IT market. He can be reached at [email protected]. Create dynamic sites with PHP & MySQL Page 2
3 Section 2. Introduction and installation The need for dynamic content The Web is no longer static; it's dynamic. As the information content of the Web grows, so does the need to make Web sites more dynamic. Think of an e-shop that has 1,000 products. The owner has to create 1,000 Web pages (one for each product), and whenever anything changes, the owner has to change all those pages. Ouch!!! Wouldn't it be easier to have only one page that created and served the content on the fly from the information about the products stored in a database, depending on the client request? Nowadays sites have to change constantly and provide up-to-date news, information, stock prices, and customized pages. PHP and SQL are two ways to make your site dynamic. PHP PHP is a robust, server-side, open source scripting language that is extremely flexible and actually fun to learn. PHP is also cross platform, which means your PHP scripts will run on Unix, Linux, or an NT server. MySQL SQL is the standard query language for interacting with databases. MySQL is an open source, SQL database server that is more or less free and extremely fast. MySQL is also cross platform. Create dynamic sites with PHP & MySQL Page 3
4 Installing Apache server routines First we will install the Apache server routines in the Linux environment. To install these packages you will need root access to your server. If someone else is hosting your site, ask the administrator to install them for you. Installing Apache is relatively simple. First download the Apache archive, apache_x.x.xx.tar.gz (the latest I downloaded was apache_ tar.gz) from the Apache site and save it in /tmp/src directory. Go to that directory: # cd /tmp/src/ Extract the files with the command: # gunzip -dc apache_x.x.xx.tar.gz tar xv replacing those xs with your version number. Change to the directory that has been created: # cd apache_x.x.xx Now to configure and install apache, type the commands: #./configure --prefix=/usr/local/apache --enable-module=so # make # make install This will install Apache in the directory /usr/local/apache. If you want to install Apache to a different directory, replace /usr/local/apache with your directory in the prefix. That's it! Apache is installed. You might want to change the default server name to something of real value. To do this, open the httpd.conf file (located at /usr/local/apache/conf) and find the line starting with ServerName. Change it to ServerName localhost. To test your install, start up your Apache HTTP server by running: # /usr/local/apache/bin/apachectl start You should see a message like "httpd started". Open your Web browser and type " in the location bar (replace localhost with your ServerName if you set it differently). You should see a nice welcome page. Create dynamic sites with PHP & MySQL Page 4
5 Installing MySQL Next comes MySQL. We will follow the same procedure (replacing those xs again with our version number). Download the source from the MySQL site and save it in /tmp/src. The latest version I found was mysql tar.gz. # cd /tmp/src/ # gunzip -dc mysql-x.xx.xx.tar.gz tar xv # cd mysql-x.xx.xx #./configure --prefix=/usr/local/mysql # make # make install MySQL is installed. Now you need to create the grant tables: # scripts/mysql_install_db Then start the MySQL server: # /usr/local/bin/safe_mysqld & And test your installation by typing: mysql -uroot -p At the password prompt, just press Enter. You should see something like: Welcome to MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 5 to server version Type 'help' for help. mysql> If you see this, you have MySQL running properly. If you don't, try installing MySQL again. Type status to see the MySQL server status. Type quit to exit the prompt. Installing PHP We will follow a similar procedure to install PHP. Download and save the source from the PHP site to /tmp/src: # cd /tmp/src/ # gunzip -dc php-x.x.xx.tar.gz tar xv # cd php-x.x.xx #./configure --with-mysql=/usr/local/mysql --with-apxs=/usr/local/apache/bin/apxs # make # make install Copy the ini file to the proper directory: # cp php.ini-dist /usr/local/lib/php.ini Open httpd.conf in your text editor (probably located in /usr/local/apache/conf directory), and Create dynamic sites with PHP & MySQL Page 5
6 find a section that looks like the following: # And for PHP 4.x, use: # #AddType application/x-httpd-php.php #AddType application/x-httpd-php-source.phps Just remove those #s before the AddType line so that it looks like: # And for PHP 4.x, use: # AddType application/x-httpd-php.php.phtml AddType application/x-httpd-php-source.phps Save your file and restart apache: # /usr/local/apache/bin/apachectl stop # /usr/local/apache/bin/apachectl start Then test whether you have PHP installed properly. Type the following code in a text editor and save it as test.php in a directory accessible by your Web server: phpinfo(); Set the permission of the file to executable by typing at console chmod 775 test.php, and then view it with your browser. You should see a detailed description of the environment variables in PHP similar to the image below. If you don't, then PHP was not installed properly. Try reinstalling it. Make sure there is a section "MySQL" in the php info; if not, MySQL connectivity will not work. Create dynamic sites with PHP & MySQL Page 6
7 Section 3. Start coding Your first script Following tradition, we will begin coding with a "hello world" example. Fire up your text editor and type the following code: echo "Hello World"; Save the file as first.php and view it in the browser (remember to set the permission to chmod 775 first). The page shows "Hello World". View the HTML source of this page through your browser. You will only see the text Hello World. This happened because PHP processed the code, and the code told PHP to output the string "Hello World". Notice the and. These are delimiters and enclose a block of PHP code. tells PHP to process all the lines following this as PHP code and tells PHP to stop processing. All lines beyond this scope are passed as HTML to the browser. Your first database Now that we have PHP running properly and have created our first script, let's create our first database and see what we can do with it. Drop to console and type in the following command: mysqladmin -uroot create learndb This creates a database named "learndb" for us to use. Here we have assumed that you are root user. If you are logged in as another user, just use the command mysqladmin -uusername -pyourpassword create learndb, replacing username and yourpassword with your username and password respectively. If you are hosting your site through a hosting company, you probably don't have permission to run mysqladmin. In this case, you have to ask your server administrator to create the database for you. Next we will create tables in this database and enter some information. Go to the console. Type: mysql You should see something like: Welcome to MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 5 to server version Type 'help' for help. Type: CONNECT learndb Create dynamic sites with PHP & MySQL Page 7
8 CREATE TABLE personnel ( id int NOT NULL AUTO_INCREMENT, firstname varchar(25), lastname varchar(20), nick varchar(12), varchar(35), salary int, PRIMARY KEY (id), UNIQUE id (id) ); INSERT INTO personnel VALUES ('1','John','Lever','John', '[email protected]','75000'); INSERT INTO personnel VALUES ('2','Camilla','Anderson','Rose', '[email protected]','66000'); This creates a table with 5 fields and puts some information in it. Where's my view? Now that we have a database with some information with it, let's see if we can view it with PHP. Save the following text as viewdb.php: $db = mysql_connect("localhost", "root", ""); $result = mysql_query("select * FROM personnel",$db); echo "<TABLE>"; echo"<tr><td><b>full Name</B><TD><B>Nick Name</B><TD><B>Salary</B></TR>"; while ($myrow = mysql_fetch_array($result)) echo "<TR><TD>"; echo $myrow["firstname"]; echo " "; echo $myrow["lastname"]; echo "<TD>"; echo $myrow["nick"]; Create dynamic sites with PHP & MySQL Page 8
9 echo "<TD>"; echo $myrow["salary"]; echo "</TABLE>"; Run it through your browser and you will see a personnel database. But what is this code doing and how is it generated? Let's examine the code. First we declare a variable $db. In PHP we declare a variable by putting the '$' sign before it. The string after $ is the name of that variable. We assign value to it by coding:$variable_name=somevalue; (example: $count=4;) Remember to put ';' after all the lines that are executable in PHP. So we declare the variable $db and create a connection to the mysql database with the statement "mysql_connect("localhost", "root", "")". In plain English, it means connect to MySQL database in localhost server with the username root and password "". Replace them with your own username and password if they are different. Then we assign a pointer to this database to $db; in other words, $db points to our database server localhost. Next we select the database with which we want to interact with the lines "" which means we wish to use the database "learndb" located by the pointer variable $db. But we want information from the database, so we query the database with the lines "$result = mysql_query("select * FROM personnel",$db);" The part "SELECT * FROM personnel" is an SQL statement (in case you don't know SQL), which means select all the stuff from the database personnel. We run this query with the PHP command mysql_query() and save the result returned by the database to the variable $result. Now we can access the different data in the different rows of the database from the $result variable. We use the function mysql_fetch_array() to extract each row from $result and assign them to variable $myrow. So $myrow contains information about each row as opposed to all the rows in $result. Then we output the data contained in each row. "echo $myrow["firstname"];" means send to output the value contained in the field "firstname" of the row contained in $myrow; in other words, we access different fields of the row with $myrow["fieldname"]. We have used the while() loop here, which means as long as or while there are data to be extracted from $result, execute the lines within those brackets. Thus we get nicely formatted output in our browser. Viewing the PHP code and the HTML source from the browser side-by-side may help you easily understand the procedure. Congratulations! You have Create dynamic sites with PHP & MySQL Page 9
10 created your first dynamic page. Create dynamic sites with PHP & MySQL Page 10
11 Section 4. Add new records Create dynamic sites with PHP & MySQL Page 11
12 Creating an HTML form So now you can view records stored in your MySQL database and display them in your browser using PHP. But you want to add new record. Assuming that you know about HTML forms, let's code a page that will do just that. First we'll create a static form, datain.html: <BODY> <form method="post" action="datain.php"> First name:<input type="text" name="first"><br> Last name:<input type="text" name="last"><br> Nick Name:<input type="text" name="nickname"><br> <input type="text" name=" "><br> Salary:<input type="text" name="salary"><br> <input type="submit" name="submit" value="enter information"> </form> Now we have a form that will post the information to a page "datain.php". We must code this page so that it is able to process the posted data and send it to our MySQL database. The following listing of datain.php will do that: $db = mysql_connect("localhost", "root",""); $sql = "INSERT INTO personnel (firstname, lastname, nick, , salary) VALUES ('$first','$last','$nickname',' $result = mysql_query($sql); echo "Thank you! Information entered.\n"; The first 3 lines are same as before, only we use the SQL command "INSERT INTO", which means insert into the database into the columns specified (here firstname, lastname, nick, ) the data contained in the variable '$first','$last','$nickname','$ ' respectively. But where did these variables come from? Well, PHP has a wonderful way of creating the variables automatically from the data posted to it. So the text box with name "first" created the variable $first and it contained the text typed in that textbox. Create dynamic sites with PHP & MySQL Page 12
13 Putting it together Now let's merge the code into one file. We will call it input.php if($submit) $db = mysql_connect("localhost", "root",""); $sql = "INSERT INTO personnel (firstname, lastname, nick, , salary) VALUES ('$first','$last','$nic $result = mysql_query($sql); echo "Thank you! Information entered.\n"; else <form method="post" action="input.php"> First name:<input type="text" name="first"><br> Last name:<input type="text" name="last"><br> Nick Name:<input type="text" name="nickname"><br> <input type="text" name=" "><br> Salary:<input type="text" name="salary"><br> <input type="submit" name="submit" value="enter information"></form> <? This creates a script that shows the form when there is no input or otherwise enters the information into the database. How does the script understand when to do what? We have already learned that PHP automatically creates variable with information posted to it. So it will create the variable $submit if the form is posted. The script determines whether there exists the variable $submit. If it exists and contains a value then we have to enter the posted values into the database; otherwise, we have to show the form. So now we can enter information to our database and view it. Try inserting some new data into the database and check to see if it really works by viewing them with viewdb.php. Create dynamic sites with PHP & MySQL Page 13
14 Section 5. Get a better view Passing variables Let's take a different view now and consider how information can be passed to another PHP page. One method is by using forms as we have done already; another is by using query strings. What are query strings? Change the line method="post" to method="get" in our script input.php. Now try submitting new data into the database with it. After clicking submit you will see our familiar "Thank you! Information entered" in the browser. But look at the URL. It looks something like: Look closely. Now the information is passed as a string in the URL instead of posting directly. The sentence after the? is the query string, and as you can see it contains the name of the variable and its values. When PHP receives a query string like?first=john it automatically creates a variable named $first and assigns the value from the query string to it. So it is equivalent to $first="john"; When more than one variable is present, the variables are separated by an ampersand (&). Viewing individual rows So now we will create a script that will display the information of a particular row in our database defined by the variable $id. Save the following code as view.php. Try viewing it through your Web server as (here we have passed the variable $id=2 through the query string). The page should show information corresponding to the id 2 in the MySQL database. $db = mysql_connect("localhost", "root", ""); $result = mysql_query("select * FROM personnel WHERE id=$id",$db); $myrow = mysql_fetch_array($result); echo "First Name: ".$myrow["firstname"]; echo "<br>last Name: ".$myrow["lastname"]; echo "<br>nick Name: ".$myrow["nick"]; echo "<br> address: ".$myrow[" "]; echo "<br>salary: ".$myrow["salary"]; Here the SQL command has changed and it tells the database to search for the row that has the value $id. But can't multiple rows contain the same values of id? Generally a column can contain any value, the same or different. But in our database two rows can never have the same value of id, as we have defined id as UNIQUE when we created our database. We immediately modify our previous viewdb.php to viewdb2.php so that it can call view.php with the proper query string. Create dynamic sites with PHP & MySQL Page 14
15 $db = mysql_connect("localhost", "root", ""); $result = mysql_query("select * FROM personnel",$db); echo "<TABLE BORDER=2>"; echo"<tr><td><b>full Name</B><TD><B>Nick Name</B><TD><B>Options</B></TR>"; while ($myrow = mysql_fetch_array($result)) echo "<TR><TD>".$myrow["firstname"]." ".$myrow["lastname"]."<td>".$myrow["nick"]; echo "<TD><a href=\"view.php?id=".$myrow[id]."\">view</a>"; echo "</TABLE>"; Viewing this page will show a list of names and corresponding nicknames. Look at the third column with a hyperlink view. Take your mouse over the hyperlink and look what it points to. The link should be something like and the links in each row will be different. Click on one of the links. It will bring up our previously coded view.php showing the detailed information of that person. How is this achieved? Let's take a look at our code viewdb2.php. Look at line 11, where all the real stuff takes place. The only unfamiliar thing here should be those odd dots (.) all around the line. The dot (.) is a concatenating operator in PHP, which means it concatenates the two strings on its two sides, which in turn means that if we write echo "Hello"."World", the output will actually be "HelloWorld". In our example we use the concatenate operator to generate a line like: <TR><TD>Camilla Anderson<TD>Rose<TD><a href="view.php?id=2">view</a> for the browser. Create dynamic sites with PHP & MySQL Page 15
16 Section 6. Delete, edit, and search data Deleting rows So far we have only entered new information in our database and viewed it. Where's the fun if we can't trash some of those data, at least the useless ones? Our delete.php will do just that. It works exactly like view.php. The only difference is the SQL command "DELETE FROM personnel WHERE id=$id", which tell MySQL to delete the row that contains the id corresponding to the variable $id. Generally, the SQL command for deleting a row is DELETE FROM database_name WHERE field_name=somevalue $db = mysql_connect("localhost", "root", ""); mysql_query("delete FROM personnel WHERE id=$id",$db); echo "Information Deleted"; Once again we modify our previous viewdb2.php script to viewdb3.php to add this new feature. The additions should be obvious. $db = mysql_connect("localhost", "root", ""); $result = mysql_query("select * FROM personnel",$db); echo "<TABLE BORDER=2>"; echo"<tr><td><b>full Name</B><TD><B>Nick Name</B><TD><B>Options</B></TR>"; while ($myrow = mysql_fetch_array($result)) echo "<TR><TD>".$myrow["firstname"]." ".$myrow["nick"]; echo "<TD><a href=\"view.php?id=".$myrow[id]."\">view</a> "; echo "<a href=\"delete.php?id=".$myrow[id]."\">delete</a>"; echo "</TABLE>"; Try clicking on delete and then view the database again with viewdb3.php to verify that the row was really deleted. You may have to refresh your browser. Editing data So far we have viewed and deleted database content. But sometimes we need to edit database content. For this we will modify our previously coded input.php file. By now you are familiar with the concept of passing variables by URL. We will call this modified script addedit.php: Create dynamic sites with PHP & MySQL Page 16
17 if($submit) $db = mysql_connect("localhost", "root",""); $sql = "INSERT INTO personnel (firstname, lastname, nick, , salary) VALUES ('$first','$last','$nickname','$ ','$salary')"; $result = mysql_query($sql); echo "Thank you! Information entered.\n"; else if($update) $db = mysql_connect("localhost", "root",""); $sql = "UPDATE personnel SET firstname='$first',lastname='$last',nick='$nickname', ='$ ', salary='$salary' WHERE id=$id"; $result = mysql_query($sql); echo "Thank you! Information updated.\n"; else if($id) $db = mysql_connect("localhost", "root", ""); $result = mysql_query("select * FROM personnel WHERE id=$id",$db); $myrow = mysql_fetch_array($result); <form method="post" action=" echo $PHP_SELF"> <input type="hidden" name="id" value=" echo $myrow["id"]"> First name:<input type="text" name="first" value=" echo > Last name:<input type="text" name="last" value=" echo $myrow["lastname"]"><br> Nick Name:<input type="text" name="nickname" value=" echo $myrow["nick"]"><br> <input type="text" name=" " value=" echo $myrow[" "]"><br> Salary:<input type="text" name="salary" value=" echo $myrow["salary"]"><br> <input type="submit" name="update" value="update information"></form> <? else <form method="post" action=" echo $PHP_SELF"> First name:<input type="text" name="first"><br> Last name:<input type="text" name="last"><br> Nick Name:<input type="text" name="nickname"><br> <input type="text" name=" "><br> Salary:<input type="text" name="salary"><br> <input type="submit" name="submit" value="enter information"></form> <? Hmmm...the code looks quite complex. But really it isn't. Previously input.php had two features: it could add information to the database or could show the form. We'll add two more features to it: the ability to show the same form but with values of a particular person already there and the ability to update records for that person. The SQL commands for entering new information and updating existing information are different, so we can't use our previous code for entering information. The script searches for the $submit variable. If it contains some value, then someone submitted new data and the information is entered into the database. If $submit does not Create dynamic sites with PHP & MySQL Page 17
18 contain any value, then someone might have just posted their updated information, so we check $update. If it contains a value, then we update that person's record with the SQL statement "UPDATE personnel SET fieldname1='$variablename1',fieldname2='$variablename2'... WHERE id=$id";". Otherwise, if someone provided the id in the query string, we show that person's information, but this time in a form so he may change it. If all these are not the case, we simply have to show the old form. Experiment with the script. Open it with your browser to see what comes up. Then call it providing query string?id=1. Change the information and click update. Verify whether the database is updated by viewing the database with viewdb3.php. Another new element was just introduced. It is the global PHP variable $PHP_SELF. This variable always contains the name of the script it is in and its location. We have used this variable in a 'form action' so no matter what you name this file, this script will always post information to itself. Once again we modify our viewing script incorporating this feature. Here's the listing for viewdb4.php: $db = mysql_connect("localhost", "root", ""); $result = mysql_query("select * FROM personnel",$db); echo "<TABLE BORDER=2>"; echo"<tr><td><b>full Name</B><TD><B>Nick Name</B><TD><B>Options</B></TR>"; while ($myrow = mysql_fetch_array($result)) echo "<TR><TD>".$myrow["firstname"]." ".$myrow["lastname"]."</a><td>".$myrow["nick"]; echo "<TD><a href=\"view.php?id=".$myrow[id]."\">view</a> "; echo "<a href=\"delete.php?id=".$myrow[id]."\">delete</a> "; echo "<a href=\"addedit.php?id=".$myrow[id]."\">edit</a>"; echo "</TABLE>"; Searching our data Information is useless if you can't find the data you require from a wealth of information. We need a way to search our database, so let's implement a search function. The page will show a static form initially and will show the search result when we have something submitted. if ($searchstring) $sql="select * FROM personnel WHERE $searchtype LIKE '%$searchstring%' ORDER BY firstname ASC"; $db = mysql_connect("localhost", "root", ""); $result = mysql_query($sql,$db); echo "<TABLE BORDER=2>"; echo"<tr><td><b>full Name</B><TD><B>Nick Name</B><TD><B>Options</B></TR>"; Create dynamic sites with PHP & MySQL Page 18
19 while ($myrow = mysql_fetch_array($result)) echo "<TR><TD>".$myrow["firstname"]." ".$myrow["nick"]; echo "<TD><a href=\"view.php?id=".$myrow["id"]."\">view</a>"; echo "</TABLE>"; else <form method="post" action=" $PHP_SELF "> <table border="2" cellspacing="2"> <tr><td>insert you search string here</td> <td>search type</td></tr> <tr> <td><input type="text" name="searchstring" size="28"></td> <td><select size="1" name="searchtype"> <option selected value="firstname">first Name</option> <option value="lastname">last Name</option> <option value="nick">nick Name</option> <option value=" "> </option> </select></td> </tr> </table> <p><input type="submit" value="submit" name="b1"><input type="reset" value="reset" ></p> </form> The script checks whether a search string exists. If $searchstring contains a value, then we have something to search; otherwise, we just show an HTML form. The part of code that searches is similar to our viewdb2.php. The SQL command deserves a bit of explanation here. Let's look at it closely. The SQL command is: "SELECT * FROM personnel WHERE $searchtype LIKE '%$searchstring%' ORDER BY firstname ASC" Two news things are introduced here, "LIKE" and "ORDER BY". LIKE simply means 'sounds like'. The '%' sign represents any possible combination of characters (numbers or letters). So to find people whose first name starts with 'J' we would use the SQL command "SELECT * FROM personnel WHERE firstname LIKE 'J%'" To find those people with a name ending with J we have to use '%J'. If we wish find people with 'J' anywhere in their name (first, middle, or last) we have to use '%J%'. 'ORDER BY' simply orders the records in ascending or descending order. The syntax is: "ORDER BY fieldname order_method" where order_method is ASC or DESC allowing the ordering to be done in ASCending or DESCending order. Create dynamic sites with PHP & MySQL Page 19
20 Section 7. Next steps: tips and resources Tips for common tasks We have covered the basics. Where you go from here is up to you. You know enough now to implement some of these useful tasks: * User database You could implement a user database. You can add a login feature to this. * News You could code a section that always displays the latest news or maybe a "What's new" section that's automatically generated. The TABLE could be something like: CREATE TABLE news ( id INT NOT NULL AUTO_INCREMENT, title VARCHAR(40), newsbody TEXT, news_date DATE, PRIMARY KEY (id), UNIQUE id (id) ); And assuming you want to automatically show the title of the latest five news items, the code could be something like: $sql="select * FROM news ORDER by news_date DESC"; $db = mysql_connect("localhost", "root", ""); mysql_select_db("newsdb",$db); $result = mysql_query($sql,$db); echo "Latest News:<br>"; $i=1; while ($myrow = mysql_fetch_array($result)) echo "<a /a><br>"; $i=$i+1; if($i>5) break; * Product database You could create a detailed database of your products. Clients could see all the products or search for particular product. Create dynamic sites with PHP & MySQL Page 20
21 Resources You'll find useful information for further study at these sites: * PHP site At this official PHP site, you will find PHP source as well as compiled binaries for both Linux and Windows. You will also find documentation and some useful links to various PHP sites, including a list of hosting providers that support PHP. * MySQL site Here you'll find news, downloads, training information, documentation, and also job information. * Apache Software Foundation site The Apache Software Foundation has created some of the best open source software projects. One of them is the Apache Web Server, which is currently the most popular Web server on the net. * AbriaSoft site AbriaSoft specializes in the setup of a PHP, MySQL development environment. Their AbriaSQL Lite, which is free, is probably the easiest solution for installing Apache, PHP3, and MySQL. * PHPBuilder site This is a must-visit resource site for PHP developers. You will find code, tips, discussion forums, news, jobs, links, and all sorts of useful stuff. Your feedback Please let us know whether this tutorial was helpful to you and how we could make it better. We'd also like to hear about other tutorial topics you'd like to see covered. Thanks! Colophon This tutorial was written entirely in XML, using the developerworks Toot-O-Matic tutorial generator. The Toot-O-Matic tool is a short Java program that uses XSLT stylesheets to convert the XML source into a number of HTML pages, a zip file, JPEG heading graphics, and two PDF files. Our ability to generate multiple text and binary formats from a single source file illustrates the power and flexibility of XML. Create dynamic sites with PHP & MySQL Page 21
INSTALLING, CONFIGURING, AND DEVELOPING WITH XAMPP
INSTALLING, CONFIGURING, AND DEVELOPING WITH XAMPP by Dalibor D. Dvorski, March 2007 Skills Canada Ontario DISCLAIMER: A lot of care has been taken in the accuracy of information provided in this article,
A table is a collection of related data entries and it consists of columns and rows.
CST 250 MySQL Notes (Source: www.w3schools.com) MySQL is the most popular open-source database system. What is MySQL? MySQL is a database. The data in MySQL is stored in database objects called tables.
SQL Injection. Blossom Hands-on exercises for computer forensics and security
Copyright: The development of this document is funded by Higher Education of Academy. Permission is granted to copy, distribute and /or modify this document under a license compliant with the Creative
CPE111 COMPUTER EXPLORATION
CPE111 COMPUTER EXPLORATION BUILDING A WEB SERVER ASSIGNMENT You will create your own web application on your local web server in your newly installed Ubuntu Desktop on Oracle VM VirtualBox. This is a
A Brief Introduction to MySQL
A Brief Introduction to MySQL by Derek Schuurman Introduction to Databases A database is a structured collection of logically related data. One common type of database is the relational database, a term
Apache 2.0 Installation Guide
Apache 2.0 Installation Guide Ryan Spangler [email protected] http://ceut.uww.edu May 2002 Department of Business Education/ Computer and Network Administration Copyright Ryan Spangler 2002 Table of
Server side scripting and databases
Three components used in typical web application Server side scripting and databases How Web Applications interact with server side databases Browser Web server Database server Web server Web server Apache
LAMP Quickstart for Red Hat Enterprise Linux 4
LAMP Quickstart for Red Hat Enterprise Linux 4 Dave Jaffe Dell Enterprise Marketing December 2005 Introduction A very common way to build web applications with a database backend is called a LAMP Stack,
Other Language Types CMSC 330: Organization of Programming Languages
Other Language Types CMSC 330: Organization of Programming Languages Markup and Query Languages Markup languages Set of annotations to text Query languages Make queries to databases & information systems
Application note: SQL@CHIP Connecting the IPC@CHIP to a Database
Application note: SQL@CHIP Connecting the IPC@CHIP to a Database 1. Introduction This application note describes how to connect an IPC@CHIP to a database and exchange data between those. As there are no
How To Install Amyshelf On Windows 2000 Or Later
Contents I Table of Contents Part I Document Overview 2 Part II Document Details 3 Part III Setup 4 1 Download & Installation... 4 2 Configure MySQL... Server 6 Windows XP... Firewall Settings 13 3 Additional
Livezilla How to Install on Shared Hosting http://www.jonathanmanning.com By: Jon Manning
Livezilla How to Install on Shared Hosting By: Jon Manning This is an easy to follow tutorial on how to install Livezilla 3.2.0.2 live chat program on a linux shared hosting server using cpanel, linux
PHP Tutorial From beginner to master
PHP Tutorial From beginner to master PHP is a powerful tool for making dynamic and interactive Web pages. PHP is the widely-used, free, and efficient alternative to competitors such as Microsoft's ASP.
Installing Booked scheduler on CentOS 6.5
Installing Booked scheduler on CentOS 6.5 This guide will assume that you already have CentOS 6.x installed on your computer, I did a plain vanilla Desktop install into a Virtual Box VM for this test,
How to Install Multicraft on a VPS or Dedicated Server (Ubuntu 13.04 64 bit)
How to Install Multicraft on a VPS or Dedicated Server (Ubuntu 13.04 64 bit) Introduction Prerequisites This tutorial will show you step-by-step on how to install Multicraft 1.8.2 on a new VPS or dedicated
SIMIAN systems. Setting up a Sitellite development environment on Windows. Sitellite Content Management System
Setting up a Sitellite development environment on Windows Sitellite Content Management System Introduction For live deployment, it is strongly recommended that Sitellite be installed on a Unix-based operating
Oracle Database 10g Express
Oracle Database 10g Express This tutorial prepares the Oracle Database 10g Express Edition Developer to perform common development and administrative tasks of Oracle Database 10g Express Edition. Objectives
Version of this tutorial: 1.06a (this tutorial will going to evolve with versions of NWNX4)
Version of this tutorial: 1.06a (this tutorial will going to evolve with versions of NWNX4) The purpose of this document is to help a beginner to install all the elements necessary to use NWNX4. Throughout
Getting Started with Dynamic Web Sites
PHP Tutorial 1 Getting Started with Dynamic Web Sites Setting Up Your Computer To follow this tutorial, you ll need to have PHP, MySQL and a Web server up and running on your computer. This will be your
Install Apache on windows 8 Create your own server
Source: http://www.techscio.com/install-apache-on-windows-8/ Install Apache on windows 8 Create your own server Step 1: Downloading Apache Go to Apache download page and download the latest stable version
AD Phonebook 2.2. Installation and configuration. Dovestones Software
AD Phonebook 2.2 Installation and configuration 1 Table of Contents Introduction... 3 AD Self Update... 3 Technical Support... 3 Prerequisites... 3 Installation... 3 Adding a service account and domain
G563 Quantitative Paleontology. SQL databases. An introduction. Department of Geological Sciences Indiana University. (c) 2012, P.
SQL databases An introduction AMP: Apache, mysql, PHP This installations installs the Apache webserver, the PHP scripting language, and the mysql database on your computer: Apache: runs in the background
Using SQL Server Management Studio
Using SQL Server Management Studio Microsoft SQL Server Management Studio 2005 is a graphical tool for database designer or programmer. With SQL Server Management Studio 2005 you can: Create databases
How To Backup A Database On A Microsoft Powerpoint 3.5 (Mysqldump) On A Pcode (Mysql) On Your Pcode 3.3.5 On A Macbook Or Macbook (Powerpoint) On
Backing Up and Restoring Your MySQL Database (2004-06-15) - Contributed by Vinu Thomas Do you need to change your web host or switch your database server? This is probably the only time when you really
PHP Fast & Easy Web Development, 2nd Edition
PHP Fast & Easy Web Development, 2nd Edition Julie C. Meloni Copyright 2002 by Premier Press. All rights reserved. No part of this book may be reproduced or transmitted in any form or by any means, electronic
INSTALLATION GUIDE VERSION
INSTALLATION GUIDE VERSION 4.1 2014 Copyright 2008 2014. All rights reserved. No part of this document may be reproduced or transmitted in any form or by any means electronic or mechanical, for any purpose
CSCI110 Exercise 4: Database - MySQL
CSCI110 Exercise 4: Database - MySQL The exercise This exercise is to be completed in the laboratory and your completed work is to be shown to the laboratory tutor. The work should be done in week-8 but
What will be supplied with chemoventory package?
Requirements... 1 What will be supplied with chemoventory package?... 1 Files structure of /chemoventory... 2 Download PHP, MySQL and Zend optimizer programs... 3 Apache Installation... 3 Apache installation
Lucid Key Server v2 Installation Documentation. www.lucidcentral.org
Lucid Key Server v2 Installation Documentation Contents System Requirements...2 Web Server...3 Database Server...3 Java...3 Tomcat...3 Installation files...3 Creating the Database...3 Step 1: Create the
The Whole OS X Web Development System
The Whole OS X Web Development Title slide Building PHP/MySQL Web Databases for OS X Scot Hacker Webmaster, UC Berkeley s Graduate School of Journalism The Macworld Conference on Dreamweaver January 6-7,
FileMaker Server 9. Custom Web Publishing with PHP
FileMaker Server 9 Custom Web Publishing with PHP 2007 FileMaker, Inc. All Rights Reserved. FileMaker, Inc. 5201 Patrick Henry Drive Santa Clara, California 95054 FileMaker is a trademark of FileMaker,
OpenPro ERP Software Installation Guide 10061 Talbert Ave Suite 200 Fountain Valley, CA 92708 USA Phone 714-378-4600 Fax 714-964-1491
OpenPro ERP Software Installation Guide 10061 Talbert Ave Suite 200 Fountain Valley, CA 92708 USA Phone 714-378-4600 Fax 714-964-1491 www.openpro.com [email protected] OpenPro Installation of Software
The Web Pro Miami, Inc. 615 Santander Ave, Unit C Coral Gables, FL 33134 6505. T: 786.273.7774 [email protected] www.thewebpro.
615 Santander Ave, Unit C Coral Gables, FL 33134 6505 T: 786.273.7774 [email protected] www.thewebpro.com for v.1.06 and above Web Pro Manager is an open source website management platform that is easy
aspwebcalendar FREE / Quick Start Guide 1
aspwebcalendar FREE / Quick Start Guide 1 TABLE OF CONTENTS Quick Start Guide Table of Contents 2 About this guide 3 Chapter 1 4 System Requirements 5 Installation 7 Configuration 9 Other Notes 12 aspwebcalendar
Building Website with Drupal 7
Building Website with Drupal 7 Building Web based Application Quick and Easy Hari Tjahjo This book is for sale at http://leanpub.com/book1-en This version was published on 2014-08-25 This is a Leanpub
MySQL Quick Start Guide
Fasthosts Customer Support MySQL Quick Start Guide This guide will help you: Add a MySQL database to your account. Find your database. Add additional users. Use the MySQL command-line tools through ssh.
Content Management System
Content Management System XT-CMS INSTALL GUIDE Requirements The cms runs on PHP so the host/server it is intended to be run on should ideally be linux based with PHP 4.3 or above. A fresh install requires
5. At the Windows Component panel, select the Internet Information Services (IIS) checkbox, and then hit Next.
Installing IIS on Windows XP 1. Start 2. Go to Control Panel 3. Go to Add or RemovePrograms 4. Go to Add/Remove Windows Components 5. At the Windows Component panel, select the Internet Information Services
Welcome to Collage (Draft v0.1)
Welcome to Collage (Draft v0.1) Table of Contents Welcome to Collage (Draft v0.1)... 1 Table of Contents... 1 Overview... 2 What is Collage?... 3 Getting started... 4 Searching for Images in Collage...
OpenPro ERP Software Installation Guide REDHAT LINUX
OpenPro ERP Software Installation Guide REDHAT LINUX 10061 Talbert Ave Suite 228 Fountain Valley, CA 92708 USA Phone 714-378-4600 Fax 714-964-1491 www.openpro.com [email protected] OpenPro Installation
CC ICT-SUD. Setting up and integrate Apache, MySQL and PHP on a Linux system
LAMP CC ICT-SUD Setting up and integrate Apache, MySQL and PHP on a Linux system Installation Simple Alternative (for development/testing only): Xampp I will assume MySQL is already installed and configured
1. To start Installation: To install the reporting tool, copy the entire contents of the zip file to a directory of your choice. Run the exe.
CourseWebs Reporting Tool Desktop Application Instructions The CourseWebs Reporting tool is a desktop application that lets a system administrator modify existing reports and create new ones. Changes to
UQC103S1 UFCE47-20-1. Systems Development. uqc103s/ufce47-20-1 PHP-mySQL 1
UQC103S1 UFCE47-20-1 Systems Development uqc103s/ufce47-20-1 PHP-mySQL 1 Who? Email: [email protected] Web Site www.cems.uwe.ac.uk/~jedawson www.cems.uwe.ac.uk/~jtwebb/uqc103s1/ uqc103s/ufce47-20-1 PHP-mySQL
User Guide Zend Server Community 4.0.3
User Guide Zend Server Community 4.0.3 By Zend Technologies www.zend.com Table of Contents Abstract... 1 Password Management... 1 Support... 2 Zend Support Center... 2 Administration Interface... 3 General
PHP Integration Kit. Version 2.5.1. User Guide
PHP Integration Kit Version 2.5.1 User Guide 2012 Ping Identity Corporation. All rights reserved. PingFederate PHP Integration Kit User Guide Version 2.5.1 December, 2012 Ping Identity Corporation 1001
Central Administration QuickStart Guide
Central Administration QuickStart Guide Contents 1. Overview... 2 Licensing... 2 Documentation... 2 2. Configuring Central Administration... 3 3. Using the Central Administration web console... 4 Managing
HowTo. Planning table online
HowTo Project: Description: Planning table online Installation Version: 1.0 Date: 04.09.2008 Short description: With this document you will get information how to install the online planning table on your
Short notes on webpage programming languages
Short notes on webpage programming languages What is HTML? HTML is a language for describing web pages. HTML stands for Hyper Text Markup Language HTML is a markup language A markup language is a set of
APACHE WEB SERVER. Andri Mirzal, PhD N28-439-03
APACHE WEB SERVER Andri Mirzal, PhD N28-439-03 Introduction The Apache is an open source web server software program notable for playing a key role in the initial growth of the World Wide Web Typically
FileMaker Server 10 Help
FileMaker Server 10 Help 2007-2009 FileMaker, Inc. All Rights Reserved. FileMaker, Inc. 5201 Patrick Henry Drive Santa Clara, California 95054 FileMaker, the file folder logo, Bento and the Bento logo
PassMark Software BurnInTest Management Console. Quick start guide
PassMark Software BurnInTest Management Console Quick start guide Edition: 1.1 Date: 16 August 2013 BurnInTest Version: 7.1.1011+ BurnInTest is a trademark of PassMark software Overview For BurnInTest
Build it with Drupal 8
Build it with Drupal 8 Comprehensive guide for building common websites in Drupal 8. No programming knowledge required! Antonio Torres This book is for sale at http://leanpub.com/drupal-8-book This version
Database Administration with MySQL
Database Administration with MySQL Suitable For: Database administrators and system administrators who need to manage MySQL based services. Prerequisites: Practical knowledge of SQL Some knowledge of relational
Results CRM 2012 User Manual
Results CRM 2012 User Manual A Guide to Using Results CRM Standard, Results CRM Plus, & Results CRM Business Suite Table of Contents Installation Instructions... 1 Single User & Evaluation Installation
The following steps detail how to prepare your database.
Using databases in Second Life or Open Sim to enhance user experience Tom Connors, SciEthis Interactive 2012 Second Life and Open Sim each have a built in system for editing the virtual world that allows
MYSQL DATABASE ACCESS WITH PHP
MYSQL DATABASE ACCESS WITH PHP Fall 2009 CSCI 2910 Server Side Web Programming Typical web application interaction Database Server 3 tiered architecture Security in this interaction is critical Web Server
Web services with WebSphere Studio: Deploy and publish
Web services with WebSphere Studio: Deploy and publish Table of Contents If you're viewing this document online, you can click any of the topics below to link directly to that section. 1. Introduction...
Talend for Data Integration guide
Talend for Data Integration guide Table of Contents Introduction...2 About the author...2 Download, install and run...2 The first project...3 Set up a new project...3 Create a new Job...4 Execute the job...7
Lesson 7 - Website Administration
Lesson 7 - Website Administration If you are hired as a web designer, your client will most likely expect you do more than just create their website. They will expect you to also know how to get their
Web Development using PHP (WD_PHP) Duration 1.5 months
Duration 1.5 months Our program is a practical knowledge oriented program aimed at learning the techniques of web development using PHP, HTML, CSS & JavaScript. It has some unique features which are as
Using WS_FTP. This tutorial explains how to use WS_FTP, a File Transfer Program for Microsoft Windows. INFORMATION SYSTEMS SERVICES.
INFORMATION SYSTEMS SERVICES Using WS_FTP This tutorial explains how to use WS_FTP, a File Transfer Program for Microsoft Windows. AUTHOR: Information Systems Services DATE: July 2003 EDITION: 1.1 TUT
Installation Guide for WebSphere Application Server (WAS) and its Fix Packs on AIX V5.3L
Installation Guide for WebSphere Application Server (WAS) and its Fix Packs on AIX V5.3L Introduction: This guide is written to help any person with little knowledge in AIX V5.3L to prepare the P Server
Customer Control Panel Manual
Customer Control Panel Manual Contents Introduction... 2 Before you begin... 2 Logging in to the Control Panel... 2 Resetting your Control Panel password.... 3 Managing FTP... 4 FTP details for your website...
Cacti The ULTIMATE Management Solution
Cacti The ULTIMATE Management Solution Cacti SNMP Management Installation HOW-TO For Linux Author: Lee Carter Published: October 20 th 2004 Version 2 Updated November 1, 2004 Table of Contents Purpose...3
Installation of PHP, MariaDB, and Apache
Installation of PHP, MariaDB, and Apache A few years ago, one would have had to walk over to the closest pizza store to order a pizza, go over to the bank to transfer money from one account to another
Setup and Administration for ISVs
17 Setup and Administration for ISVs ISV accounts for both hosted and private cloud support white labeling functionality and give you the ability to provision and manage customer tenants directly. A customer
INSTALLING KAAZING WEBSOCKET GATEWAY - HTML5 EDITION ON AN AMAZON EC2 CLOUD SERVER
INSTALLING KAAZING WEBSOCKET GATEWAY - HTML5 EDITION ON AN AMAZON EC2 CLOUD SERVER A TECHNICAL WHITEPAPER Copyright 2012 Kaazing Corporation. All rights reserved. kaazing.com Executive Overview This document
PHP+MYSQL, EASYPHP INSTALLATION GUIDE
PHP+MYSQL, EASYPHP INSTALLATION GUIDE EasyPhp is a tool to install and configure an Apache server along with a database manager, MySQL. Download the latest version from http://www.easyphp.org/ as seen
Example for Using the PrestaShop Web Service : CRUD
Example for Using the PrestaShop Web Service : CRUD This tutorial shows you how to use the PrestaShop web service with PHP library by creating a "CRUD". Prerequisites: - PrestaShop 1.4 installed on a server
FileMaker Server 11. FileMaker Server Help
FileMaker Server 11 FileMaker Server Help 2010 FileMaker, Inc. All Rights Reserved. FileMaker, Inc. 5201 Patrick Henry Drive Santa Clara, California 95054 FileMaker is a trademark of FileMaker, Inc. registered
Deploying the BIG-IP System v10 with Oracle Application Server 10g R2
DEPLOYMENT GUIDE Deploying the BIG-IP System v10 with Oracle Application Server 10g R2 Version 1.1 Table of Contents Table of Contents Deploying the BIG-IP system v10 with Oracle s Application Server 10g
FileMaker Server 12. FileMaker Server Help
FileMaker Server 12 FileMaker Server Help 2010-2012 FileMaker, Inc. All Rights Reserved. FileMaker, Inc. 5201 Patrick Henry Drive Santa Clara, California 95054 FileMaker is a trademark of FileMaker, Inc.
Release Bulletin Sybase ETL Small Business Edition 4.2
Release Bulletin Sybase ETL Small Business Edition 4.2 Document ID: DC00737-01-0420-02 Last revised: November 16, 2007 Topic Page 1. Accessing current release bulletin information 2 2. Product summary
Advanced Tornado TWENTYONE. 21.1 Advanced Tornado. 21.2 Accessing MySQL from Python LAB
21.1 Advanced Tornado Advanced Tornado One of the main reasons we might want to use a web framework like Tornado is that they hide a lot of the boilerplate stuff that we don t really care about, like escaping
WebSpy Vantage Ultimate 2.2 Web Module Administrators Guide
WebSpy Vantage Ultimate 2.2 Web Module Administrators Guide This document is intended to help you get started using WebSpy Vantage Ultimate and the Web Module. For more detailed information, please see
AJ Matrix V5. Installation Manual
AJ Matrix V5 Installation Manual AJ Square Consultancy Services (p) Ltd., The Lord's Garden, #1-12, Vilacheri Main Road, Vilacheri, Madurai-625 006.TN.INDIA, Ph:+91-452-3917717, 3917790. Fax : 2484600
Horizon Debt Collect. User s and Administrator s Guide
Horizon Debt Collect User s and Administrator s Guide Microsoft, Windows, Windows NT, Windows 2000, Windows XP, and SQL Server are registered trademarks of Microsoft Corporation. Sybase is a registered
Installation Instructions
Installation Instructions 25 February 2014 SIAM AST Installation Instructions 2 Table of Contents Server Software Requirements... 3 Summary of the Installation Steps... 3 Application Access Levels... 3
MySQL Quick Start Guide
Quick Start Guide MySQL Quick Start Guide SQL databases provide many benefits to the web designer, allowing you to dynamically update your web pages, collect and maintain customer data and allowing customers
Using Form Scripts in WEBPLUS
Using Form Scripts in WEBPLUS In WEBPLUS you have the built-in ability to create forms that can be sent to your email address via Serif Web Resources. This is a nice simple option that s easy to set up,
SVNManager Installation. Documentation. Department of Public Health Erasmus MC University Medical Center
SVNManager Installation Documentation M. Verkerk Department of Public Health Erasmus MC University Medical Center Page 2 July 2005 Preface Version control in the context of this document is all about keeping
IBM WebSphere Application Server V8.5 lab Basic Liberty profile administration using the job manager
IBM WebSphere Application Server V8.5 lab Basic Liberty profile administration using the job manager Scenario You are a system administrator responsible for managing web application server installations.
PHP Authentication Schemes
7 PHP Authentication Schemes IN THIS CHAPTER Overview Generating Passwords Authenticating User Against Text Files Authenticating Users by IP Address Authenticating Users Using HTTP Authentication Authenticating
Installation Guide for contineo
Installation Guide for contineo Sebastian Stein Michael Scholz 2007-02-07, contineo version 2.5 Contents 1 Overview 2 2 Installation 2 2.1 Server and Database....................... 2 2.2 Deployment............................
We begin with a number of definitions, and follow through to the conclusion of the installation.
Owl-Hosted Server Version 0.9x HOW TO Set up Owl using cpanel Introduction Much of the documentation for the installation of Owl Intranet Knowledgebase assumes a knowledge of servers, and that the installation
Eucalyptus 3.4.2 User Console Guide
Eucalyptus 3.4.2 User Console Guide 2014-02-23 Eucalyptus Systems Eucalyptus Contents 2 Contents User Console Overview...4 Install the Eucalyptus User Console...5 Install on Centos / RHEL 6.3...5 Configure
An Email Newsletter Using ASP Smart Mailer and Advanced HTML Editor
An Email Newsletter Using ASP Smart Mailer and Advanced HTML Editor This tutorial is going to take you through creating a mailing list application to send out a newsletter for your site. We'll be using
SQL Injection Attack Lab Using Collabtive
Laboratory for Computer Security Education 1 SQL Injection Attack Lab Using Collabtive (Web Application: Collabtive) Copyright c 2006-2011 Wenliang Du, Syracuse University. The development of this document
This installation guide will help you install your chosen IceTheme Template with the Cloner Installer package.
Introduction This installation guide will help you install your chosen IceTheme Template with the Cloner Installer package. There are 2 ways of installing the theme: 1- Using the Clone Installer Package
Welcome to PowerClaim Net Services!
Welcome to PowerClaim Net Services! PowerClaim Net Services provides a convenient means to manage your claims over the internet and provides detailed reporting services. You can access PowerClaim Net Services
ProxiBlue Dynamic Category Products
ProxiBlue Dynamic Category Products Thank you for purchasing our product. Support, and any queries, please log a support request via http://support.proxiblue.com.au If you are upgrading from a pre v3 version,
An Introduction to Developing ez Publish Extensions
An Introduction to Developing ez Publish Extensions Felix Woldt Monday 21 January 2008 12:05:00 am Most Content Management System requirements can be fulfilled by ez Publish without any custom PHP coding.
Getting an ipath server running on Linux
Getting an ipath server running on Linux Table of Contents Table of Contents... 2 1.0. Introduction... 3 2.0. Overview... 3 3.0. Installing Linux... 3 4.0. Installing software that ipath requires... 3
