Upload
mikeash82
View
4.402
Download
0
Embed Size (px)
Citation preview
Using XamppXAMPP is a free and open source web server package, consisting mainly of the Apache HTTP Server, MySQL database, and interpreters for scripts written in the PHP and Perl programming languages. It provides a local web server for easy testing of server dependent websites
It can be used as a development tool, to allow website designers and programmers to test their work on their own computers without any access to the Internet.
Using Xampp by Michael Ashinze Page 1
Using Xampp by Michael Ashinze Page 2
Click here to add Security Password
Click here
Using Xampp by Michael Ashinze Page 3
Type in your password and click
password changing
ndndn
“”
Click here for
phpmyadmin
Using Xampp by Michael Ashinze Page 4
Log in with the user name and password that you chose earlier
Using Xampp by Michael Ashinze Page 5
To create database
Type in a database Name Here we have chosen member
And click create
Using Xampp by Michael Ashinze Page 6
Type in your table name and Number of FieldsHere we will use details and 5
And click Go
ndndn
Enter the field names as shown
Using Xampp by Michael Ashinze Page 7
For the ID field Select Primary on the index menuand tick the A_I field
Using Xampp by Michael Ashinze Page 8
Click save
Using Xampp by Michael Ashinze Page 9
Table has been created
Click Insert to add records
Using Xampp by Michael Ashinze Page 10
Enter records and click Go
Using Xampp by Michael Ashinze Page 11
Now one record has been added
Using Xampp by Michael Ashinze Page 12
Now we need a website that will allow us connect to the database with a form.
Define a new site
Click New site
Using Xampp by Michael Ashinze Page 13
Define the site name as phptutorial
Using Xampp by Michael Ashinze Page 14
Tick yes to allow for server side technology
Then select PHP MySQL
Click Next
Using Xampp by Michael Ashinze Page 15
Browse to your Xampp Folder on your C drive.
Note. When creating a server based site, your root folder must be stored on the server which in this case is your
Xampp > htdocs
Your root folder must be in the htdocs folder.
Using Xampp by Michael Ashinze Page 16
Browse to your C/xampp/htdocs/
You must save your php based websites in the htdocs folder
Click open > select
Using Xampp by Michael Ashinze Page 17
Now create a new folder called phptutorial
*This is your root drive
Click next
Using Xampp by Michael Ashinze Page 18
Select Edit locally and make sure your new folder is in the right location
Click Next
Using Xampp by Michael Ashinze Page 19
Your local URL must be
http://localhost/foldername/
For this tutorial it should be http://localhost/phptutorial/
Test the URL to make sure it works right
Click Next
Click ok
Click ok
Using Xampp by Michael Ashinze Page 20
Click Next
Using Xampp by Michael Ashinze Page 21
Click Done
Click ok
Using Xampp by Michael Ashinze Page 22
Now we will create a page, but we will be creating a php page instead of a regular HTML page. This is because we need to connect our website to the server side database using a server side programming language like php
Using Xampp by Michael Ashinze Page 23
Click new
Using Xampp by Michael Ashinze Page 24
Select phpSelect the highlighted layout
Click create
Using Xampp by Michael Ashinze Page 25
Now for this examples we will just make changes to the page as follows
The heading: Elatt Comments Form
Using Xampp by Michael Ashinze Page 26
Now delete the text in the content area
And
Click Save as
Using Xampp by Michael Ashinze Page 27
Save as index.php
Php is the file extension
And click save
Add Some text to the main body of the page as above
Using Xampp by Michael Ashinze Page 28
Now from the windows menu select Database
Using Xampp by Michael Ashinze Page 29
On the Database tab,Select the + sign and Click MysqlConnection
Select your Connection name This can be any name you choose. We have chosen to use tutorial
Server name: Usually your localhost
Username: This is your Xampp user name
Password: This is your Xampp password
Database: This is the database you intend to use. it must be a database that you have created.Here we are using member
Using Xampp by Michael Ashinze Page 30
Use the information provided but make sure you use your Xammp password.
Then click the test button.
If everything goes well you should have this message
Click ok and ok again
Using Xampp by Michael Ashinze Page 31
Database panel showing your connection tutorial
This means that your site is now connected to your database by by connected called tutorial
Click on the common drop down,
select the data tab and select
Record Insertion Form Wizard
Using Xampp by Michael Ashinze Page 32
connections tab : tutorial
Table: From the dropdown select the table details
Then you should see all the fields in the details table
Using Xampp by Michael Ashinze Page 33
Type in thankyou.php in the After Inserting, go to: field" --- This page will created later
Then click the – sign to remove a field from the field list.
Here we have removed the ID field since it has been set as a primary key and AI (auto increment) value in the database.
We don’t want the students to choose their own ID’s.
The Database will choose one for them
Then Click OK
Now a new form has been created ready to act as the comments form on your site
Using Xampp by Michael Ashinze Page 34
To change the name, you have to select the button. Then change the value from the properties panel to Send
Now we can see that the form button says insert record.
We need to change the value to a more appropriate name
Using Xampp by Michael Ashinze Page 35
Using Xampp by Michael Ashinze Page 36
Now create your new thankyou.php page. This page will act as the result page when a user has submitted a comment
Select a new php page and then chose a good page layout
Then click create
Using Xampp by Michael Ashinze Page 37
Your New page.
Using Xampp by Michael Ashinze Page 38
Now make changes to the page as follows
The heading: Elatt Comments Form
Content: Thanks for leaving a feedback. We will get back to you shortly
Using Xampp by Michael Ashinze Page 39
Save the page as thankyou.php
The page is saved as thankyou.php because you have redirected the form to go to a page called thankyou.php.
Using Xampp by Michael Ashinze Page 40
Now Preview Your site
Using any available Browsers
Select Don’t show me this message again for both pop-up messages and click yes
Using Xampp by Michael Ashinze Page 41
Now type in new records.
Firstname: JohnLastname: SmithEmail: [email protected]: I am interested in web design
Then click Send
Using Xampp by Michael Ashinze Page 42
Final Result
Your database has been updated with the new record. You can check it out by logging into phpmyadmin.