» » Page redirect/jump method in WEB development

 

Page redirect/jump method in WEB development

Author: bamboo06 on 31-10-2014, 17:25, views: 4261

9
Page Jump may be due to the user to click a link, button trigger, also may be the system automatically generated. Page automatically jump is often used in WEB development, and according to the demand can be with a jump in different ways, such as the prompt operation information delay jump, this paper summarizes some common page Jump method in WEB development.


PHP header () function jump
PHP header () function is very powerful, which in the URL page Jump also called simple, using header () to jump directly to the specified URL page, then the page Jump is a 302 redirect:

$url = "http://www.goocode.net/";   
header( "Location: $url" ); 

We may encounter special jump, such as website correcting a page address to do 301 redirection, of course you can be realized through the web configuration rewrite, but now I want to tell you, you can use the PHP header () function to do 301 jumps, the code as follows:
$url = "http://www.goocode.net/";
//301 redirect
if($_GET['t']=='301') header( "HTTP/1.1 301 Moved Permanently" );    
header( "Location: $url" );


Set meta to jump/redirect
HTML meta information can be set to jump directly, you can set the delay time URL jump and jump, often used, such as pay over tell users pay for success and jump to the order page, the code is very simple, in the to add a sentence:
<meta http-equiv="refresh" content="5;url=http://www.goocode.net">

It will redirect to http://www.goocode.net after 5 seconds.

javascript jump
javascript jump is also very simple, direct words:
<script> 
window.location.href="http://www.goocode.net"; 
</script> 

Note, the code above directly after the jump, in the target page address is not available antecedents (referer, also called source), in the actual project, meet customer requirements to jump to bring Road (i.e. target Webpage can get to the page where the jump to), this time, we can simulate a click javascript, and then jump to meet customer demand.
<script> 
//With referer
var aa = document.createElement("a"); 
aa.setAttribute("href","http://www.goocode.net"); 
var bodys=document.getElementsByTagName("body")[0]; 
bodys.appendChild(aa); 
aa.click(); 
</script> 

Of course, in the actual development we can put the two ways to integrate into PHP, easy to apply in various jump demand.

Category: PHP Scripts / Javascript

Dear visitor, you are browsing our website as Guest.
We strongly recommend you to register and login to view hidden contents.
<
  • 0 Comments
  • 0 Articles
12 April 2017 06:04

bismilahallah

Reply
  • Group: Guests
  • РRegistered date: --
  • Status:
 
I have always wondered how this superior essay writing was redirected to another page. Now I know the way to having the redirect option operate in web development. This has been very informative, thanks!

<
  • 0 Comments
  • 0 Articles
16 April 2017 12:55

alikhan_095

Reply
  • Group: Guests
  • РRegistered date: --
  • Status:
 
I was looking for url=http://jameshayes.postach.io/post/how-can-writing-prompts-improve-your-skill
s]paper writing help[/url] with respect to this self motivation topic I am working on. I thought I would be able to do it on my own but seems like this is not the case. I just really hope I am able to find something useful!

<
  • 0 Comments
  • 0 Articles
20 April 2017 23:28

rozi

Reply
  • Group: Guests
  • РRegistered date: --
  • Status:
 
I would recommend my profile is important to me, I invite you to discuss this topic. Kissing Magic

<
  • 0 Comments
  • 0 Articles
21 April 2017 03:28

rozi

Reply
  • Group: Guests
  • РRegistered date: --
  • Status:
 
It is fine, nonetheless evaluate the information and facts around this correct. How To Kiss A Man To Make Him Fall In Love

<
  • 0 Comments
  • 0 Articles
21 April 2017 20:02

rozi

Reply
  • Group: Guests
  • РRegistered date: --
  • Status:
 
Awesome dispatch! I am indeed getting apt to over this info, is truly neighborly my buddy. Likewise fantastic blog here among many of the costly info you acquire. Reserve up the beneficial process you are doing here.Hero Instinct

<
  • 0 Comments
  • 0 Articles
26 May 2017 20:53

Write My Essay

Reply
  • Group: Guests
  • РRegistered date: --
  • Status:
 
Page Jump might be because of the client to click a connection, catch trigger, additionally might be the framework naturally created. Page consequently hop is regularly utilized as a part of WEB improvement, and as indicated by the request can be with a bounce in various courses, for example, the provoke operation data postpone hop, this paper condenses some normal page Jump technique in WEB advancement. Write My Essay

<
  • 0 Comments
  • 0 Articles
Reply
  • Group: Guests
  • РRegistered date: --
  • Status:
 
Page Jump may be a direct result of the customer to click an association, get trigger, moreover may be the system normally made. Page thus bounce is consistently used as a piece of WEB change, and as shown by the demand can be with a bob in different courses, for instance, the incite operation information delay jump, this paper gathers some ordinary page Jump strategy in WEB progression. Writing an Effective Case Study

Page therefore skip is reliably utilized as a bit of WEB change, and as appeared by the request can be with a bounce in various courses, for example, the induce operation data postpone hop, this paper assembles some customary page Jump procedure in WEB movement. DissertationHouse

Page hence skip is dependably used as a touch of WEB change, and as showed up by the demand can be with a bob in different courses, for instance, the actuate operation information put off bounce, this paper collects some standard page Jump methodology in WEB development. Affordable Research Paper Writing Service

<
  • 0 Comments
  • 0 Articles
20 June 2017 03:38

john

Reply
  • Group: Guests
  • РRegistered date: --
  • Status:
 
You have done a great job. I will definitely dig it and personally recommend to my friends. I am confident they will be benefited from this site best hiking tour oahu

<
  • 0 Comments
  • 0 Articles
24 January 2018 14:00

replica omega watches

Reply
  • Group: Guests
  • РRegistered date: --
  • Status:
 
Eternal secret rolex replica tourbillon watch, this brand self-developed self-winding movement replica watch structure, attention focused on this complex but weighs only replica watches uk 0.305 grams of the tourbillon body to ensure that the device is fake watches operating accurately.

Information
Comment on the news site is possible only within (days) days from the date of publication.