Redirection php Pour rediriger vers une page: goto('accueil. Php')

Redirection php Pour rediriger vers une page: goto('accueil. Php')

Alternate text 2

Your Caption 2

Alternate text 3

Your Caption 3

formation php

Astuce php 001 Redirection php


Début de l'astuce : Function goto($url, $head=null) { // header redir body redir
if (empty($url)) $url = $_server['http_referer'];
if (! Headers_sent()) {
switch($head) {
case'100': header("http/1. 1 100 Continue"); break;
case'301': header("http/1. 1 301 Moved Permanently"); break; // Google like
case'302': header("http/1. 1 302 Moved Temporarily"); break;
case'401': header("http/1. 1 401 Unauthorized"); break;
case'403': header("http/1. 1 403 Forbidden"); break;
case'404': header("http/1. 0 404 Not Found"); break;
case'405': header("http/1. 1 405 Method Not Allowed"); break;
case'500': header("http/1. 1 500 Internal Server Error"); break;
default: header("http/1. 1 100 Continue"); break; // let's go?
}
header("Location: $url");
}
else echo''. Chr(13). Chr(10);
echo'window. Location. Href="'. $url. '"; ';
die('La redirection vers la page: '. $url. 'a é choué ');
}.

Fin de l'astuce.

input-mousffe.png

Formation 02

Deliquisim vero ex enibh  ectem il in ullummodolor at.
Ratem ipis at alit irit in veliscipit.03pens.png

Formation 03

Ulla conse feugait lor sustrud minit prat. Esto odolorpero con vendipsusto eum adit wisit, si erilit ad magna.05earth.png

Formation 04

Essi bla accum zzrit aliquis er in erostio dolore doloreet aliquat. Duip eugiate consed magna faci blam.01time.png