18 basic PHP examples for beginners

Source: Internet
Author: User
The original content of this site. for reprinted content, please indicate the source webpage. How can we create our first PHP page? Very simple! Select the best design tool for our application. of course, you can only use notepad. Remember to keep it after creation

Original content of this site. for reprinted content, please indicate the sourceWebpage Tutorial network.

How can we create our first PHP page? Very simple! Select the best design tool for our application. of course, you can only use notepad. After creation, remember to keep the file named PHP extended and upload it to our server.

Before writing a PHP program, we usually need to configure our environment. that is to say, the server must support PHP.

  I. basic structure of PHP:

Application Include function



Your page Subject and domain name

The above content is the title of each page of our application. do not change it.

The header of each page:


''Your others meta tag
''Your others meta tag
''Your others meta tag
''Your others meta tag
''Your others meta tag
''Your others meta tag
''Your others meta tag
Put the important javascripts code here
Put the CSS settings here

The above content is retained as header. php, so that the headers of each page are the same.


All content on your page


Keep it as footer. php so that the bottom of each page is the same.

Enter our copyright information


  II. how to output text or establish a connection to text using PHP

How to display text in PHP? Run the following command:

How to create a connection?

How to create a connection with a style?

'Echo 'is used to display the output.

  3. how to implement paging:

If a lot of content is displayed on your page, we will consider using paging to display it.

Simple paging code:



Webjx.com







Home

Page 1

Page 2

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.