Home Backend Development PHP Tutorial Interaction between PHP and Web pages

Interaction between PHP and Web pages

Jul 04, 2018 pm 05:38 PM

This article mainly introduces the interaction between PHP and Web pages. It has a certain reference value. Now I share it with everyone. Friends in need can refer to it

1.form form default situation The way to submit data is the get method.

2. The predefined variables used by PHP scripts to process form data are $_GET, $_POST (case sensitive)

Code example (Pay special attention to adding the array when adding the checkbox attribute name)

##simpleTest.html

<!DOCTYPE html><html><head><meta charset="UTF-8"><title>Insert title here</title></head><body><form action="simpleForm.php" method="post">
    用户名:<input type="text" name="username"><br>
    密码:<input type="text" name="password"><br>
    <!-- 复选框 -->
     学过的编程语言是:<br>
    <input type="checkbox" name="language[]" value="PHP">php    
    <input type="checkbox" name="language[]" value="java">java    
    <input type="checkbox" name="language[]" value="C#">C#    
    <input type="checkbox" name="language[]" value="C++">C++<br>
    <input type="submit" value="提交" ></form></body></html>
Copy after login

simpleFoem. php

<?php
if(!empty($_POST["username"])){    
if($_POST["username"]=="zhangsan"&&$_POST["password"]=="123"){        
echo "欢迎您:".$_POST["username"]."<br/>";        
echo "学过的编程语言:";        
foreach ($_POST["language"] as $value){            
echo  $value;
            
        }
        
    }else {        
    echo "用户名密码错误";
    }
}    
?>
Copy after login

The above is the entire content of this article. I hope it will be helpful to everyone's study. For more related content, please pay attention to the PHP Chinese website!

Related recommendations:

Analysis of PHP’s AOP ideas

Introduction to installing xhprof for performance analysis in PHP 7.1

The above is the detailed content of Interaction between PHP and Web pages. For more information, please follow other related articles on the PHP Chinese website!

Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Article

R.E.P.O. Energy Crystals Explained and What They Do (Yellow Crystal)
2 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
Repo: How To Revive Teammates
1 months ago By 尊渡假赌尊渡假赌尊渡假赌
Hello Kitty Island Adventure: How To Get Giant Seeds
4 weeks ago By 尊渡假赌尊渡假赌尊渡假赌

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

Turn on split-screen interaction in win11 Turn on split-screen interaction in win11 Dec 25, 2023 pm 03:05 PM

In the win11 system, we can enable multiple monitors to use the same system and operate together by turning on split-screen interaction. However, many friends do not know how to turn on split-screen interaction. In fact, just find the monitor in the system settings. The following is Get up and study. How to open split-screen interaction in win11 1. Click on the Start menu and find "Settings" 2. Then find the "System" settings there. 3. After entering the system settings, select "Display" on the left. 4. Then select "Extend these displays" in the multi-monitor on the right.

Vue3+TS+Vite development skills: how to interact with the backend API Vue3+TS+Vite development skills: how to interact with the backend API Sep 08, 2023 pm 06:01 PM

Vue3+TS+Vite development skills: How to interact with the back-end API Introduction: In web application development, data interaction between the front-end and the back-end is a very important link. As a popular front-end framework, Vue3 has many ways to interact with back-end APIs. This article will introduce how to use the Vue3+TypeScript+Vite development environment to interact with the back-end API, and deepen understanding through code examples. 1. Use Axios to send requests. Axios is

How does uniapp implementation use JSBridge to interact with native How does uniapp implementation use JSBridge to interact with native Oct 20, 2023 am 08:44 AM

How uniapp implements using JSBridge to interact with native requires specific code examples 1. Background introduction In mobile application development, sometimes it is necessary to interact with the native environment, such as calling some native functions or obtaining some native data. As a cross-platform mobile application development framework, uniapp provides a convenient way to interact with native devices, using JSBridge to communicate. JSBridge is a technical solution for the front-end to interact with the mobile native end.

Methods and FAQs for interacting with PHP and JavaScript Methods and FAQs for interacting with PHP and JavaScript Jun 08, 2023 am 11:33 AM

PHP and JavaScript interaction methods and FAQs With the rapid development of the Internet, web pages have become the main platform for people to obtain information and communicate. PHP and JavaScript are the two most commonly used languages ​​for developing web pages. They all have their own advantages and applicable scenarios, and in the development process of large websites, the combination of the two will expand the work capabilities of developers. This article will introduce the methods of interaction between PHP and JavaScript and answers to common questions. PHP and JavaScript

The development history and trend prospects of front-end and back-end development The development history and trend prospects of front-end and back-end development Mar 26, 2024 am 08:03 AM

With the rapid development of the Internet and the rapid changes in information technology, front-end and back-end development, as two important IT fields, have also made great progress in the past few decades. This article will explore the development history of front-end and back-end development, analyze current development trends, and look forward to future development directions. 1. The development history of front-end and back-end development In the early stages of the Internet, website development mainly focused on the presentation of content, and front-end development work mainly focused on technologies such as HTML, CSS, and JavaScript to achieve the basic functionality of the page.

How to use the enterprise WeChat interface to interact with PHP for data How to use the enterprise WeChat interface to interact with PHP for data Jul 05, 2023 am 09:00 AM

How to use the Enterprise WeChat interface to interact with PHP for data. Enterprise WeChat is an important platform for internal communication and collaboration within the enterprise. Developers can realize data interaction with Enterprise WeChat through the Enterprise WeChat interface. This article will introduce how to use PHP language to call the enterprise WeChat interface to realize data transmission and processing. First, you need to create an enterprise WeChat application and obtain the corresponding CorpID, Secret and AgentID. This information can be found in the "Applications and Mini Programs" in the Enterprise WeChat management backend. Next, I

How to use Swoole to implement WebSocket server and client interaction How to use Swoole to implement WebSocket server and client interaction Nov 07, 2023 pm 02:15 PM

WebSocket has become a commonly used real-time communication protocol in modern web applications. Developing WebSocket servers using PHP generally requires the use of extensions such as Swoole, because it provides support for asynchronous programming, process management, memory mapping, and other WebSocket-related features. In this article, we will discuss how to use Swoole to implement WebSocket server-client interaction and provide some specific code examples. Swoole and W

Front-end and back-end responsibilities and skill requirements Front-end and back-end responsibilities and skill requirements Mar 25, 2024 pm 07:00 PM

Front-end and back-end are two indispensable parts of software development, and they respectively bear different responsibilities and skill requirements. This article will explore the job content and requirements of front-end and back-end development engineers in terms of responsibilities and skills. 1. Responsibilities and skill requirements of front-end engineers Front-end engineers are responsible for implementing user interface and interactive functions and facing users directly. They need to have the following responsibilities and skill requirements: implement the user interface design of the website or application to ensure good page visual effects and interactive experience; Work closely with UI/UX designers to transform design drafts into

See all articles