This article mainly introduces the php method for obtaining url parameters. The example summarizes the method for parsing URL using the parse_url () function. For more information, see the example in this article. Share it with you for your
$id =$_get["id"];
echo $id;
?>
Copy CodeFirst in the Apache fileOpen the Apache configuration file httpd.conf and find the following: #LoadModule rewrite_module modules/mod_rewrite.soTurn on the rewrite and go to the front "#
Convert URLs to static URLs
function Url_rewrite ($file, $params = Array (), $html = "", $rewrite = True)
{
if ($rewrite) {//development phase is not rewrite, where the development of the time, put $rewrite = False
$url = ($file =
It may be rare for you to write and play on your own. {Code...} and {code...} directly use php and mysql for page flip. why is the first one useful, and the second one useless after Page Flip to the second? Even if {code...} is used in the second
For URL encoding in PHP, urlencode () or rawurlencode () can be used. The difference between the two is that the former encodes space into +, while the latter encodes space into % 20, however, it should be noted that only part of the URL should be
Convert URLs to static URLs
function Url_rewrite ($file, $params = Array (), $html = "", $rewrite = True) {
if ($rewrite) {//development phase is not rewrite, where the development of the time, put $rewrite = False
$url = ($file
Phpurl redirection code
We will introduce you to a relatively complete url redirection and page jump code. For more information, see.The code is as follows:
0) { echo EOT; exit; } else {
This article mainly introduces the php method for obtaining url parameters. The example summarizes the method for parsing URL using the parse_url () function. For more information, see the example in this article. Share it with you for your
In use? Garbled characters occur when the Chinese parameter is passed in id = "Chinese". This is the result of second transcoding. In php, Chinese characters cannot be directly transmitted in URLs, I am always dissatisfied with this. No way. Who
The following describes the introduction and examples.Parse_url ($ str url );Convert a url into an arrayPrint_r (parse_url ("www.111cn.net"); // Parse the url and output the returned array/*Returns a string in special url format to a normal
A website about mobile phone, with WordPress base board.
The original htacess is placed in the main directory/var/www/html
Rewriteengine onrewritebase/rewriterule ^items/products/(\d+)/(. *)? $ items/products.php?number=$1&name=$2 [QSA ,
PHP Address bar Chinese $_get down after garbled, UrlEncode and urldecode usage of the detailed
URL encoding
Syntax: string urlencode (String str);
return value: String
Function type: Encoding processing
For example:
Copy CodeThe code is as follows:
The url desktop shortcut generated by php may be difficult for you to see where the following code is incorrect. The generated shortcut is always unable to get the url value url. php & lt ;? & Nbsp; header ('content-Type: & nbsp; text/html; & nbsp;
With PHP and MySQL to do something, with a
Select the image uploaded to the database URL is the absolute path, the query out after the display, how to make a relative path (such as: Http://192.168.40.10:1500/php/www/pictures/1.jpeg), trouble
If you are using apache or linux, url Chinese Garbled text is a very common issue. The following small series will introduce the solution to the Chinese Garbled text transmitted by url in php, I hope this method will help you.
In use? Garbled
, Urldecode () and rawurldecode () decoded strings are encoded in UTF-8 format, if the URL contains Chinese, and the page setting is not a UTF-8, the decoded string must be converted before it can be properly displayed.
Php tutorial description of
In the thinkphp case, there is a. htaccess file with URL rewriting rules configured, such as IfModulemod_rewrite.cRewriteEngineonRewriteCond % {REQUEST_FILENAME }! -DRewriteCond % {REQUEST_FILENAME }! -FRewriteRule ^ (. *) $ index. php $1 [QSA, PT,
String urlencode (string str)Returns a string -_. all other non-alphanumeric characters will be replaced with a semicolon (%) followed by two hexadecimal numbers, and spaces will be encoded as the plus sign (+ ).Example 1: Difference between
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.