Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to solve the problem of not getting parameters by php

2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/03 Report--

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!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report