header("Location:...") question

This is a discussion on header("Location:...") question within the PHP Language forums, part of the PHP Programming Forums category; Stijn Goris wrote: > Hi all, > > I have a question regarding the header function. I send a browser ...


Go Back   Usenet Forums > PHP Programming Forums > PHP Language

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 09-13-2003
powerboy
 
Posts: n/a
Default Re: header("Location:...") question

Stijn Goris wrote:

> Hi all,
>
> I have a question regarding the header function. I send a browser to a
> certain page (eg first.php ) wich sends no output to the browser.
> This page sends the browser to another page (eg second.php) with the
> header("Location:") function. second.php doesn't either send any
> output to the browser. The browser is then send to another page also
> with the header() function.
>
> Now my problem: I have to send user and password data fromfirst.php to
> second.php. Will the user be able to see the
> login.php?formGebruiker=$gebr&formPas=$pas url when redirecting or is
> this all handled on the server internalyy (since there is no output
> to the browser)?
>
> I hope you get my question
>
> regards
> Stijn


A header is sent to the browser, so the login info will be visible in
url of the redirected to page.

Have a look into sessions:
http://php.net/manual/en/ref.session.php

With sessions, only a session ID will be viewable by the user, all
other data is stored server-side.
Reply With Quote
  #2 (permalink)  
Old 09-13-2003
Stijn Goris
 
Posts: n/a
Default header("Location:...") question

Hi all,

I have a question regarding the header function. I send a browser to a
certain page (eg first.php ) wich sends no output to the browser. This page
sends the browser to another page (eg second.php) with the
header("Location:") function. second.php doesn't either send any output to
the browser. The browser is then send to another page also with the header()
function.

Now my problem: I have to send user and password data fromfirst.php to
second.php. Will the user be able to see the
login.php?formGebruiker=$gebr&formPas=$pas url when redirecting or is this
all handled on the server internalyy (since there is no output to the
browser)?

I hope you get my question

regards
Stijn


Reply With Quote
  #3 (permalink)  
Old 09-13-2003
Alex Farran
 
Posts: n/a
Default Re: header("Location:...") question

Stijn Goris writes:

> Hi all,
> I have a question regarding the header function. I send a browser to a
> certain page (eg first.php ) wich sends no output to the browser. This page
> sends the browser to another page (eg second.php) with the
> header("Location:") function. second.php doesn't either send any output to
> the browser. The browser is then send to another page also with the header()
> function.


> Now my problem: I have to send user and password data fromfirst.php to
> second.php. Will the user be able to see the
> login.php?formGebruiker=$gebr&formPas=$pas url when redirecting or is this
> all handled on the server internalyy (since there is no output to the
> browser)?


> I hope you get my question


I think I do. Simplified:
first.php redirects to second.php?somedata=something.
second.php redirects to third.html.
third.html displays something and doesn't redirect anywhere.

No the user won't see second.php?somedata=something, but that URL will
be passed to the browser. Redirections are not internal to the
server. The page with the 'Location:' header is sent to the browser
which then reads it and requests the URL it finds there.

If you really don't want that information escaping from the server you
should use a session to store it locally.

--

__o Alex Farran
_`\<,_ Analyst / Programmer
(_)/ (_) www.alexfarran.com

Reply With Quote
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT +1. The time now is 06:13 AM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0