how to create a website with html and php the very basics by alexander niehoff

14
How to create a website with HTML and PHP The very basics By Alexander Niehoff

Upload: arthur-payne

Post on 27-Dec-2015

222 views

Category:

Documents


2 download

TRANSCRIPT

Page 1: How to create a website with HTML and PHP The very basics By Alexander Niehoff

How to create a website with HTML and PHP The very basics

By Alexander Niehoff

Page 2: How to create a website with HTML and PHP The very basics By Alexander Niehoff

Content

What is HTML?

What is PHP?

What else do i need for a website?

CSS – Cascading Style Sheets

Page 3: How to create a website with HTML and PHP The very basics By Alexander Niehoff

Hypertext Markup Language

Page 4: How to create a website with HTML and PHP The very basics By Alexander Niehoff

What is HTML?

Hypertext Markup Language

Text-based markup language for structuring digital content

Every browser can read HTML

Structuring of text and objects with ‘tags’ <start tag>

</end tag>

Page 5: How to create a website with HTML and PHP The very basics By Alexander Niehoff

HTML basic structure

<!DOCTYPE html>

<html>

<head><meta><title></title></head>

<body>

Content

</body>

</html>

Declare this document as HTML

Start of the head sectionMetadata like ‚author‘ or ‚keywords‘ Title that appears in the tab or topbar

Start of the content section

End of the content section End of HTML-code

Example

End of the head section

Start of HTML-code

Page 6: How to create a website with HTML and PHP The very basics By Alexander Niehoff

<b></b>, <i></i>, <u></u>

<br>

<img src=“ “ alt=“ “>

<a href=“ “></a>

<input type=“ “>

<table><tr><td></></></>

<font></font>

HTML common tags

bold, italic and underline

forces a word wrap

include an image or picture

hyperlink (also known as ‚link‘)

creates a text- or password area, or a button

tags to create a table

change color, font-family or size of text

Further defined with ‚width‘, ‚height‘, ‚name‘, ‚value‘ …

Page 7: How to create a website with HTML and PHP The very basics By Alexander Niehoff

Hypertext Preprocessor

Page 8: How to create a website with HTML and PHP The very basics By Alexander Niehoff

What is PHP?

Hypertext Preprocessor, originally Personal Home Page Tools

Server-side scripting language for web development

Needs an extra program to run (like apache or nginx)

Can be simply mixed with HTML

Can connect and interact with databases

GET and transfer inserted data like text and files … www.example.com/contact.php

POST and transfer inserted data www.example.com/contact.php

?name=Alexander&lastName=Niehoff

Page 9: How to create a website with HTML and PHP The very basics By Alexander Niehoff

PHP basic structure

<body>

<?php$name="Alex";echo "Your name is " . $name . ", right?";?>

</body>

Example

The PHP-Code is inside the HTML body-tag

Initiation of PHP-code Definition of a

variable

Text output including the variable „Alex“

Marks the end of PHP-code

Page 10: How to create a website with HTML and PHP The very basics By Alexander Niehoff

Example of a very basic website

Click me

Page 11: How to create a website with HTML and PHP The very basics By Alexander Niehoff

What else is needed?

Page 12: How to create a website with HTML and PHP The very basics By Alexander Niehoff

What else is needed?

Server (own or rented) If own server

Fast upload and download

Properly set port forwarding on the router

Domain (www.thisismydomain.[de, com, biz, gov, …])

Database (MySQL, Oracle, etc …)

Good sense for design Design via CSS

Page 13: How to create a website with HTML and PHP The very basics By Alexander Niehoff

CSS stands for Cascading Style Sheets

External file

Define how to display HTML elements

HTML elements should get an identifier

What is CSS?

HTML filecssEx.html

CSS filestyle.css

<body>

<h1>Headline one</h1>This is just some random text…

</body>body {font-family: calibri,“Times New Roman“;background-color: #C9C9C9;}

h1 {font-size: 22pt;color: green;}

Page 14: How to create a website with HTML and PHP The very basics By Alexander Niehoff

Thank you for your attention

and have a nice day

If you have any question you may ask them now