473,386 Members | 1,741 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

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
Jul 16 '05 #1
2 4396
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.
Jul 16 '05 #2
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

Jul 16 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

11
by: Francisco Mendez | last post by:
I get the following message when trying to run my script: "Warning: Cannot modify header information - headers already sent by (output started at /var/www/html/newcustomer.php:23) in...
13
by: Dave Smithz | last post by:
Hi there, I have a php script that does some form input validation. As it verifies each field if the field has incorrect data, it appends an error message to an $error array. E.g. if...
6
by: bissatch | last post by:
Hi, I am trying to use the following function: header("Location: http://www.mysite.co.uk/home/update/index.php"); ....but getting the following error: Warning: Cannot modify header...
5
by: Duderino82 | last post by:
I'm working on a very simple peace of php where basically there is a form and 3 buttoms. One refreshed the page, one posts the form, and another one (since this form contains values of a record)...
3
by: thomasg | last post by:
Hi, I am moving some scripts from a UNIX box to a Windows box. A data entry form calls a PHP script the updates the records from the form. After the script completes, The script redirects to...
2
by: hagenaer | last post by:
Hello, I'm building a simple shopping cart to work with PayPal. I'd like to have the user post his basket to my page, validate the input, then redirect him _with his validated form data_ to...
4
by: andre rodier | last post by:
Hello, I need to display or propose a jpeg image on a web page. When I need to display the image, I use this code : header("Content-Length: $fileSize") ; header("Content-Type: $type") ;...
6
by: webgenius | last post by:
I'm designing a small site and I have this structure in mind: index.php --------------- login fields. User enters login info. LoginCheck.php is called. LoginCheck.php -----------------------...
5
bilibytes
by: bilibytes | last post by:
hi, i am making a website with php OOP. i have a class called session: it has the attribues -logged_in; -user_name; -user_ip; -user_level;
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.