49
Using Xampp XAMPP 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

Embed Size (px)

Citation preview

Page 1: Using Xampp

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

Page 2: Using Xampp

Using Xampp by Michael Ashinze Page 2

Click here to add Security Password

Click here

Page 3: Using Xampp

Using Xampp by Michael Ashinze Page 3

Type in your password and click

password changing

ndndn

“”

Click here for

phpmyadmin

Page 4: Using Xampp

Using Xampp by Michael Ashinze Page 4

Log in with the user name and password that you chose earlier

Page 5: Using Xampp

Using Xampp by Michael Ashinze Page 5

To create database

Type in a database Name Here we have chosen member

And click create

Page 6: Using Xampp

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

Page 7: Using Xampp

Using Xampp by Michael Ashinze Page 7

For the ID field Select Primary on the index menuand tick the A_I field

Page 8: Using Xampp

Using Xampp by Michael Ashinze Page 8

Click save

Page 9: Using Xampp

Using Xampp by Michael Ashinze Page 9

Table has been created

Click Insert to add records

Page 10: Using Xampp

Using Xampp by Michael Ashinze Page 10

Enter records and click Go

Page 11: Using Xampp

Using Xampp by Michael Ashinze Page 11

Now one record has been added

Page 12: Using Xampp

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

Page 13: Using Xampp

Using Xampp by Michael Ashinze Page 13

Define the site name as phptutorial

Page 14: Using Xampp

Using Xampp by Michael Ashinze Page 14

Tick yes to allow for server side technology

Then select PHP MySQL

Click Next

Page 15: Using Xampp

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.

Page 16: Using Xampp

Using Xampp by Michael Ashinze Page 16

Browse to your C/xampp/htdocs/

You must save your php based websites in the htdocs folder

Page 17: Using Xampp

Click open > select

Using Xampp by Michael Ashinze Page 17

Now create a new folder called phptutorial

*This is your root drive

Page 18: Using Xampp

Click next

Using Xampp by Michael Ashinze Page 18

Select Edit locally and make sure your new folder is in the right location

Page 19: Using Xampp

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

Page 20: Using Xampp

Click Next

Click ok

Click ok

Using Xampp by Michael Ashinze Page 20

Page 21: Using Xampp

Click Next

Using Xampp by Michael Ashinze Page 21

Page 22: Using Xampp

Click Done

Click ok

Using Xampp by Michael Ashinze Page 22

Page 23: Using Xampp

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

Page 24: Using Xampp

Using Xampp by Michael Ashinze Page 24

Select phpSelect the highlighted layout

Click create

Page 25: Using Xampp

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

Page 26: Using Xampp

Using Xampp by Michael Ashinze Page 26

Now delete the text in the content area

And

Click Save as

Page 27: Using Xampp

Using Xampp by Michael Ashinze Page 27

Save as index.php

Php is the file extension

And click save

Page 28: Using Xampp

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

Page 29: Using Xampp

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

Page 30: Using Xampp

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

Page 31: Using Xampp

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

Page 32: Using Xampp

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

Page 33: Using Xampp

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

Page 34: Using Xampp

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

Page 35: Using Xampp

Using Xampp by Michael Ashinze Page 35

Page 36: Using Xampp

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

Page 37: Using Xampp

Using Xampp by Michael Ashinze Page 37

Your New page.

Page 38: Using Xampp

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

Page 39: Using Xampp

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.

Page 40: Using Xampp

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

Page 41: Using Xampp

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

Page 42: Using Xampp

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.