Creation a Web page with PHP

Creation a Web page with PHP


Hi! My name is Evgenia Hristova and in this video, I’ll show how to create a very simple web page with PHP. I have installed XAMPP and I must run Apache Server and MySQL server. Close XAMPP. I am using the browser Firefox Developer Edition. In the address bar I am going to write http://localhost. After this, I can see the first screen of XAMPP. I have a link to PHP info. I can see the version of . PHP – the current version here is 7.1.1 but this is enough for our very simple task for beginners From the first screen, I have link for PhpMyAdmin. This is a tool for using the MySQL server in XAMPP. I have installed NetBeans 8.2 too. Now we will create our first PHP project. This project will be created in the subfolder of XAMPP folder – htdocs. The name of the project will be “first”. In NetBeans – File – New Project – PHP – PHP Application – Next. In the field for Project Name I am going to type: first. PHP version in NetBeans will be 7 and encoding is UTF-8. Next. The project URL is http://localhost/first Next. Here is an opportunity to use a framework. But we will write pure PHP! Here is an opportunity to use Composer. In this course we don’t use Composer. We will continue with “finish”. The project is ready. We can see the project folder in folder htdocs too. The folder nbproject is created automatically and it is used of NetBeans to manage the project properties. The file index.php was created with the creation of the project “first”. Here is a comment created automatically. I am going to delete this comment. created automatically. I am going to delete this comment.
Between the tagsI will type: echo “Hi, PHP!”; Click on the Save button. In the browser I am going to type URL http://localhost/first. I can see the text of the web page here. Our first project will contain the tasks for the basics things in PHP as operators, code rules, variables and so on. I am going to use bootstrap template for css for a better view of the pages. We can download css theme from the site of Bootrsap and insert in our project. After clicking on the button for downlad I get the source code of the css. Select all, right mouse button and copy Then go to the project “first” and in the folder css I am going to create css file and use paste. Select All – Copy – Paste The css code has only one row and that is normal – save. I will make “Refresh” the page in the browser. I can’t see any changes on my first page. I can’t see the link for css file in the head of the index.php. With drag and drop the bootstrap file I can get this link automatically. I am going to set the title of the page – save. I will make “Refresh” the page in the browser. I can see the change of the font. This font is sans-serif now. That is sign for worked css code here. I am going to add div with a class “container”. I am going to add div with a class “row”. I will move the php code in the div with a class “row” Shit +Alt + F This is the shortcut for the automated formatting of the code in NetBeans. There is a change of the page. I will add a tag for Heading 1. There is a change of the page. Right mouse button – View source or Tools – Inspector and I can see the html code of the page. This code was generated from PHP script in my index.php We can see the css styles of bootstrap here – on the right side. We have created a project with CSS style and PHP code that generated a message on this page.

Author: Kevin Mason

Leave a Reply

Your email address will not be published. Required fields are marked *