Get the App
SLTechnology News&Howtos  ›  Development  › 

How to solve the problem of not getting parameters by php

Shulou Source: shulou.com Published: 2022-06-03 10:51:54 10月20日 Update

This article mainly introduces how php can not get the parameters of the problem, has a certain reference value, interested friends can refer to, I hope you can learn a lot after reading this article, the following let the editor with you to understand.

The solution that php can't get parameters: 1, set "$_ SERVER [" REQUEST_URI "]; 2, define the characters to query; 3, use" substr ($url, $length); "to get parameters.

This article operating environment: windows7 system, PHP7.1 version, Dell G3 computer.

The solution to the problem that PHP can not get the # & and other special characters in the url passing parameters

Some symbols cannot be passed directly in URL and cannot be passed into PHP for processing, such as # & symbols, which cannot be obtained through $_ GET, such as a domain name https://localhost/url.php?url=yangyufei+eating&drinking

You can't get yangyufei+eating&drinking through $_ GET ['url'], you can only get yangyufei eating.

At this time, we can only be flexible. If the user accesses this address, does his browser address bar have the full form of the link? all we have to do is read the link in the visitor's address bar, and then we can process it and get the complete data.

Url.php writes the following

The code is as follows:

So the output is yangyufei+eating&drinking.

It meets the requirements.

Thank you for reading this article carefully. I hope the article "how to solve the problem of php without parameters" shared by the editor will be helpful to everyone. At the same time, I also hope that you will support us and pay attention to the industry information channel. More related knowledge is waiting for you to learn!

Tags: Parameters articles addresses questions characters symbols links processing special code value interest content method at the same time domain name that is form data method Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Redmi MariaDB macOS NVidia Huawei