data show site, PHP-MYSQL Course | ||||||||||||||||
| ||||||||||||||||
| ||||||||||||||||
The Testing ServerIf you wish to install a local testing server, you can download the
XAMPP package for Windows http://www.apachefriends.org/en/xampp.html
To make your testing server start automatically
when your computer starts, you can check the Svc checkbox beside both
options. If the XAMPP Control Panel is not already running, go to C:\xampp\control.exe to open the panel. | ||||||||||||||||
1- XAMPP Control Panel | ||||||||||||||||
| ||||||||||||||||
With your testing server now installed and running, there are a few
final steps you should take to make sure everything is configured to work
perfectly.
| ||||||||||||||||
2-
List of Files the php and txt files corresponding, stored at data show Folder: 1- index.php - php file 2- Text-Doc - txt file | ||||||||||||||||
| ||||||||||||||||
Defining a Dreamweaver Site | ||||||||||||||||
Once a testing server is set up, either locally or using a remote hosting service, you will need to define a site for Dynamic Development in Dreamweaver | ||||||||||||||||
Step 1: Start the site definition
In Dreamweaver go to Site -> New Site. | ||||||||||||||||
Step 2: Enter the local
Information
In this screen shot, using DW CS6 on a Windows system with XAMPP
installed. you will set the Local Information. This sets the Site Name,
and local path for files in your site. | ||||||||||||||||
| ||||||||||||||||
Step 3: Servers
The next setting is to connect to servers. In DW CS6 and above, this done by selecting the servers section: | ||||||||||||||||
| ||||||||||||||||
and clicking the plus icon to define a new server
connection. at Basic tab, For the Name you can enter the same name as the Site definition, When using a local testing server, set Connect Using to "Local/Network" | ||||||||||||||||
|
||||||||||||||||
Set the Server Folder to the same location as the local
files set in the initial Site Settings. Server Name: myDBsite connect using: Local/Network Server Folder: C:\xampp\htdocs\myDBsite Web URL: http://localhost/myDBsite | ||||||||||||||||
| ||||||||||||||||
at Advanced tab, | ||||||||||||||||
Click the advanced button and set the Application model
to PHP / MySQL Server Model: PHP MySQL | ||||||||||||||||
| ||||||||||||||||
then click Save. Once the connection is defined, there are check boxes to set the connection as a testing or remote connection, check the testing option. | ||||||||||||||||
| ||||||||||||||||
and then Click Save, the Dreamweaver dialog box display: | ||||||||||||||||
Step 4: Manage Sites | ||||||||||||||||
you can edit an existing site definition by going to Site -> Manage Sites. Your Sites: myDBsite | ||||||||||||||||
| ||||||||||||||||
then click Done | ||||||||||||||||
Setup the site's Testing Server and then click OK | ||||||||||||||||
| ||||||||||||||||
In this section, we'll look into how to create a database. A database is used to store information for your site. | ||||||||||||||||
Most web hosts use a control panel for managing your site, in the control panel they will have a way to create a MySQL Database. Once a database has been created, you can use phpMyAdmin to edit it. | ||||||||||||||||
phpMyAdmin is also available using most Local Testing
server packages like XAMPP. The Start pages for those server will have a
link to open phpMyAdmin. Step 1: Create Database, Table and Insert data in phpMyAdmin, go to the Databases tab : in Create database input myDB and click the Create button to have the database created: | ||||||||||||||||
| ||||||||||||||||
go to the Structure tab. the myDB database that we will be using : Create table Name = MyGuests, Number of columns = 3, click Go | ||||||||||||||||
| ||||||||||||||||
information about the 3 columns of myguests tables: 1- column: id int(11) Auto_increment 2- column: firstname vachar(80) 3- column: lastname vachar(80) | ||||||||||||||||
| ||||||||||||||||
go to the Browse tab. to Browse values of columns data | ||||||||||||||||
| ||||||||||||||||
| ||||||||||||||||
index.php page
File | ||||||||||||||||
Now that a site and a database are created, lets connect
the 2 together. Before creating the database connection, a new PHP file needs to be created and saved to the site | ||||||||||||||||
Step 1: Create a New PHP page
Go to File -> New. In the File Creation dialog, select Blank Page. From the page type section, select PHP and click the create. | ||||||||||||||||
| ||||||||||||||||
Step 2: Save the page to your site
Go to File -> Save. | ||||||||||||||||
| ||||||||||||||||
Step 3: the Site has been
defined - testing server - Once the site has been defined, at Dreamweaver - Dw display current Message: "This page may have dynamically-related files that can only be discovered by the server. Discover | Preferences. | ||||||||||||||||
| ||||||||||||||||
Step 4: Create the connection to the database | ||||||||||||||||
1) open the database panel by going to Window ->
Database. 2) In the database panel, click the plus button and select MySQL Connection 3) enter the: connection name: conmyDB MySQL server: localhost User name: root Password: Database: mydb | ||||||||||||||||
when click Select Button, to be display Select Database box, select mydb and then click Ok | ||||||||||||||||
| ||||||||||||||||
4) Click the test button then Click OK | ||||||||||||||||
| ||||||||||||||||
5) Click OK | ||||||||||||||||
Step 5: The Design and
Code of index.php 1- The Design of index.php | ||||||||||||||||
| ||||||||||||||||
2- The Code of index.php | ||||||||||||||||
| ||||||||||||||||
| ||||||||||||||||
| ||||||||||||||||
| ||||||||||||||||
|