The PHP tutorial provides multiple methods to obtain URL address bar parameters:
$ _ Server ["server_port"] // obtain the port
$ _ Server ['HTTP _ host'] // get the domain name or host address$ _ Server ['server _ name'] // get the domain name or
The following small series will bring you a comprehensive understanding of global variables in PHP. I think this is quite good. now I will share it with you and give you a reference. Let's take a look at several Super global variables (superglobals)
Search for browsers by means of cumulative adding of URLs without using the search box
Index. php? Chid = 4 & ccid18 = 197
This is a Web site. how can I change the address in the address bar of the browser when I click next link?
Index. php? Chid = 4
Php acts as a server and accepts files uploaded by the client. how does the server receive files written locally by C ++, then I want to use PHP to write a program on the server to store the file. Do I need to write a listener on the server? how can
Javascript implementation:
Top. Location. href top-level window addressThis. Location. href address of the current window
PHP implementation:
// Obtain the domain name or host addressEcho $ _ server ['HTTP _ host']. ""; # localhost// Obtain the
In php, URL redirection is inseparable from header functions no matter which method. Below I will organize some common URL jump implementation programs and methods for you. If you need them, please refer to them. In php, URL redirection is
HTTP_REFERER: returns the address package of the previous page, but sometimes it cannot be obtained, we can simulate it to do the following two processing methods that fail to get the value in the normal $ _ SERVER [\ HTTP_REFERER. HTTP_REFERER:
It is very simple to share a PHP 301 jump code. It mainly uses the header function for conversion. You can refer to the small code for PHP jump.
The Code is as follows:
$ The_host = $ _ SERVER ['HTTP _ host'];$ Request_uri = isset ($ _
Void header (string [, bool Replace [, inthttp_response_coDe])Void header (string [, bool Replace [, inthttp_response_coDe])
Header () is used to send httpheader. Replace is an optional parameter, indicating whether to replace a similar header in
Use the PHPheader () function in detail (error settings such as 301 and 404 ). If you have just started learning PHP, there may be many functions that need to be studied. today we will learn how to use PHPHeader (). for more instructions, please
PHP obtains the complete URL implementation code of the current page. Javascript implementation: Copy the code as follows: top. location. href top-level window address this. location. href current window address PHP implementation: Copy the code as
PHPheader () function description (301, 404, and other error settings ). If you have just started learning PHP, there may be many functions that need to be studied. today we will learn how to use PHPHeader (). for more instructions, please refer to
Use the PHPheader () function to implement the 404 error prompt function on the page. we have compiled the detailed usage of the PHPheader () function and shared it with you. we need to provide more support for our 404 page.
If you have just started
Understand global variables in PHP and global variables. A comprehensive understanding of global variables in PHP, a comprehensive understanding of global variables in PHP, pre-defined several Super global variables (superglobals), which means that
In this article, we will learn how to use variables and filter variables in ThinkPHP. During Web development, we often need to obtain system variables or data submitted by users. these variable data is complex and may cause security risks if we are
$ _ SERVER usage, PHP global variables, PHP environment variables, and PHP System Constants
In PHP website development, PHP is sometimes used to obtain server information. to meet the website's needs, you often need to set and apply the PHP
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.