just a quick question.... if im using header() to redirect from a page that needs to update a table and then pass 2 strings to the redirect page, can i put html form fields in before the header when they are hidden type?
if not would i have to put the results in another file?
header()
Moderator: General Moderators
Forms will not submit on a header call, furthermore outputing forms before call header will generate a fatal error. The common ways to pass data when using header are to either encode the parameters into the query string of the URL or to use session variables.
You may want to also consider writing a function to wrap around header() if you are using sessions as transparent sessions do not currently attach the SID to local URLs in headers if cookies are not used for propagation..
You may want to also consider writing a function to wrap around header() if you are using sessions as transparent sessions do not currently attach the SID to local URLs in headers if cookies are not used for propagation..
- twigletmac
- Her Royal Site Adminness
- Posts: 5371
- Joined: Tue Apr 23, 2002 2:21 am
- Location: Essex, UK
From the manual entry for header():
Mac
Hidden form fields are still HTML tags and therefore count as output. If you need to have these before the header() function is called look into output buffering.php docs wrote:Remember that header() must be called before any actual output is sent, either by normal HTML tags, blank lines in a file, or from PHP.
Mac
- hob_goblin
- Forum Regular
- Posts: 978
- Joined: Sun Apr 28, 2002 9:53 pm
- Contact:
http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html
look through it, it might have some POST header definitions...
other than that, you can try this:
1st) send it in get
2nd) grab the variables and cram them into a session
3rd) header the page to itself, without the get variables.
look through it, it might have some POST header definitions...
other than that, you can try this:
1st) send it in get
2nd) grab the variables and cram them into a session
3rd) header the page to itself, without the get variables.
ok i started toying with sessions to get past this problem, now im finding that my redirect does nothing....
can header("Location: ") be used in frames?
and also does sending session variables count as sending content to the browser such as to break the header?
i dont even get a header error it just gives a blank page
and yes, im using a full address not relative
can header("Location: ") be used in frames?
and also does sending session variables count as sending content to the browser such as to break the header?
i dont even get a header error it just gives a blank page
and yes, im using a full address not relative
- twigletmac
- Her Royal Site Adminness
- Posts: 5371
- Joined: Tue Apr 23, 2002 2:21 am
- Location: Essex, UK