PHWinfo banniere

Titres
PORTAIL ANNUAIRE ARTICLES COMPARATEUR HÉBERGEURS DEVIS FORUMS RÉDUCTEUR D'URL
Précédent   PHWinfo > Autres forums > Forum Programmation & Conception > alt.php > Re: Observations regarding redirection
S'inscrire FAQ Membres Recherche Messages du jour Marquer les forums comme lus
Re: Observations regarding redirection

Réponse
 
LinkBack Outils de la discussion
Vieux 14/09/2007, 15h58   #1
Tyno Gendo
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Observations regarding redirection

yes, i fell into that trap once...

you always need to exit( header('Location: /blah.php') ); to avoid code
after the header being executed.

Kevin Thorpe wrote:
> Albert Ahtenberg wrote:
>> Hello,
>>
>> I don't know if it is only me but I was sure that header("Location:url")
>> redirects the browser instantly to URL, or at least stops the
>> execution of
>> the code. But appearantely it continues to execute the code until the
>> browser send his reply to the header instruction. So an exit(); after
>> each
>> redirection won't hurt at all

>
> header('Location:xxx') simply adds the redirection as a header line at
> the top of the document. The rest of the script still continues to
> execute. Once the browser has loaded the document it reads the header
> and goes off to load the redirected page. You will need an exit() after
> such a redirection.
>

  Réponse avec citation
Vieux 14/09/2007, 17h49   #2
Michael Fesser
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Observations regarding redirection

..oO(Tyno Gendo)

>yes, i fell into that trap once...
>
>you always need to exit( header('Location: /blah.php') ); to avoid code
>after the header being executed.


And you have to use an absolute URL, as required by the HTTP spec.

Micha
  Réponse avec citation
Réponse


Outils de la discussion

Règles de messages
Vous ne pouvez pas créer de nouvelles discussions
Vous ne pouvez pas envoyer des réponses
Vous ne pouvez pas envoyer des pièces jointes
Vous ne pouvez pas modifier vos messages

Les balises BB sont activées : oui
Les smileys sont activés : oui
La balise [IMG] est activée : oui
Le code HTML peut être employé : non
Trackbacks are oui
Pingbacks are oui
Refbacks are oui


Fuseau horaire GMT +1. Il est actuellement 09h23.


Édité par : vBulletin®
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC5 Tous droits réservés.
Version française #16 par l'association vBulletin francophone
PHWinfo est un site Éducation Sans Frontières ©2000-2008
Ad Management by RedTyger
©Tous droits réservés par les parties respectives
Page generated in 0,06933 seconds with 10 queries