::::::::::::::::::::::::::
Home
Home Page
Method of generation of a code
Displays
Result of binding of the data
Systems of patterns of pages
Data acquisition without use XML
Data acquisition without use XML
Use JSON on the party of the client
Improved online shop
Review Ajax
Departure XMLHttpRequest
Processing of search servleta
 The search processing with help JavaScript
Problems of use Ajax
As it was more than once spoken, organization W3C is engaged mainly in development and creation of b
OASIS
Hands off PHP!
Automatic redirect (Auto Redirect) on PHP
Breaking of passwords becomes more accessible
Web2.0 Layout
Links
:::::::::::::::::::::::::

 

Automatic redirect (Auto Redirect) on PHP

I do not apply for completeness of a statement of a subject, it in fact clause{article}, instead of the handbook, but for beginning{starting} will be the introduction information in this technics{technical equipment}.


Actually, about the term:


Automatic perepanravlenie the user from page on which he has got on other page or a site. Technically to realize a redirect it is possible a lot of ways. The given mechanism should use only in unusual cases, for the reason, that search engines consider, that the redirect can be used unfair raskrutchikami, involving in such a way an audience on sobstvenyj a site from pages specially created for search machines on pages really containing a useful content that looks as a deceit poiskovikov.


Before the beginning of a narration I shall make small remarks:


* It is not necessary for you to be the PHP-programmer to understand technics{technical equipment} of a redirect;

* It is meant, that the server (be local - localhost, or your hosting on the Internet) supports performance of PHP-scripts.


And in general, if that will be not clear, favour I ask on php.net:)


The essence of technology or technics{technical equipment} of a redirect is automatic perenapravlenie someone somewhere:) And where exactly - you set in a script, thus, at performance of a script he automatically will redirect you on the certain web-address.


It turns out, that transition goes not under the direct link from a site of a kind <a href = " http: // www.google.com "> google.com </a>, and through a script.


1. We open any html-editor (though the notebook will approach also) and it typed{collected} / is inserted in him{it} the following code:



<?

$URL = " http: // www.realcoding.net ";

header (" Location: $URL ");

?>

<html>

<title> RealCoding. Net </title>

<head> </head>

<body>

</body>

</html>


2. Further we save our file with the above-stated code, for example code.php and it is loaded it{him} on the web - server. For example, if you have loaded code.php in a root folder of a site codeguru.com.ua to call a script it is possible on URL http://www.codeguru.com.ua/code.php. After execution{performance} of a script on the server you will be automatically redirected (sredirekteny:)) on a useful site for programmers realcoding.net - as it has been specified in our script.


Still it is possible simply on a site in a body of page (inside tegov <body...> </body>) to put the link of a kind:


<a href = " http: // www.codeguru.com.ua/code.php "> Transition to site Realcoding. Net </a>


Such simple technics{technical equipment} of a redirect (redirect).