how to create a website with html and php the very basics by alexander niehoff
TRANSCRIPT
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
Hypertext Markup Language
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>
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
<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‘ …
Hypertext Preprocessor
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
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
Example of a very basic website
Click me
What else is needed?
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
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;}
Thank you for your attention
and have a nice day
If you have any question you may ask them now