The unique PHP syntax is a mix of C, Java, Perl, and PHP self-innovative syntaxes. It can execute dynamic web pages more quickly than CGI or Perl. Compared with other programming languages, PHP embeds the program into HTML documents for execution.
The parameter concatenation link passed by tag a enables the join query of the parameters passed by tag a to implement the join query, just like the tag tab on the left of www.movie.hao123.com to implement the combined query ., Don't understand...,
PHP to obtain the complete URL of the current page javascript implementation:
Top. location. href top-level window address
This. location. href address of the current window
PHP implementation # test URL: http: // localhost/blog/testurl. php? Id = 5
Php global variables, which are defined by php global variables. Php global variables, php global variables define PHP global variables PHP pre-defines several Super global variables (superglobals), which means that they can use php global variables
Among the many predefined SERVER variables in PHP, $ _ SERVER [REQUEST_URI] is frequently used, but this variable is only supported by apache. therefore, we need a more general method to obtain the value of REQUEST_URI.
Among the many predefined
Help me check whether the code is standard. if statements Judge $ hosturl = $ _ SERVER ['php _ SELF ']; & nbsp; // Obtain the current urlif & nbsp; $ hosturl = "/index. php "& nbsp; // if the URL is equal to/index. php, enter the body field content {
For example, I need to obtain the current URL address.$ Url_this = "http: //". $ _ SERVER ['HTTP _ host']. $ _ SERVER ['php _ SELF '];Echo $ url_this;
Http: // localhost/lu. php
SERVER variable: $ _ SERVERNote: PHP 4.1.0 and later versions are used.
Form attributes
Action
Define a URL. Send data to this URL when you click Submit.
4
5
Data
For automatic data insertion.
5
Replace
Define what is done when a form is submitted.
5
Javascript implementation:
Top. Location. href top-level window addressThis. Location. href address of the current window
PHP implementation
# Test URL: http: // localhost/blog/testurl. php? Id = 5// Obtain the domain name or host
First, PHP retrieves the URL of the current page:
CopyCode The Code is as follows: // obtain the current Script URL
Function getcururl ()
{
If (! Empty ($ _ server ["request_uri"])
{
$ Scriptname = $ _ server ["request_uri"];
$ Nowurl = $
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
Function-based knowledgePHP implementation: The code is as follows:Copy code // Obtain the domain name or host addressEcho $ _ SERVER ['http _ host']. ""; # localhost// Obtain the webpage addressEcho $ _ SERVER ['php _ SELF ']. "";
1. header () functionThe header () function is a very simple method for page jump in PHP. The main function of the header () function is to output the HTTP header to the browser.The header () function is defined as follows:Void header (string [,
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
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.