Re: [PHP] Re: I want to use POST when redirect via PHP Header function.
On Thu, 2011-06-30 at 15:20 +0100, Geoff Lane wrote: > On Thursday, June 30, 2011, Jasper Mulder wrote: > > I think the moral is that one should never code when tired ;( > or coding while drunk... my favorite typo is $this == 'value'; or $$this = 'value'; very hard to find sometimes... As much as I hate to go off-topic even more, this is one thing that I do like about Python. The fact that requires/enforces proper indentation... but that is as far as I am going with that :) Steve. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: I want to use POST when redirect via PHP Header function.
On Thursday, June 30, 2011, Jasper Mulder wrote: > Personally, I think that incorrect spelling is far more annoying > than the quoting; that is, if it does not originate from > incapability due to English (whether it be British or American) > being not the native language, as opposed to spelling errors because > of vapidity. Personally, I'm not sure that those who are lifeless, dull, or unintersting are any more or less prone to spelling errors than the rest of us; or that the more interesting members of this list are immune! > As for the readers of this list, I am sorry to go into this non-PHP subject, > but I couldn't really let this pass. Au contraire! Typos are very much a PHP subject. Take this from someone who spent nearly two hours yesterday debuggin PHP code with imbalanced parentheses, parentheses that should have been braces - and vice versa, ampersands in place of dollar signs, and other typos! I think the moral is that one should never code when tired ;( -- Geoff -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] I want to use POST when redirect via PHP Header function.
DON't get me started on the massacre of the English language on posting sites all over the internet! It seems that people are so wrought up in their problem-of-the-moment that they don't realize that they are mis-spelling, mis-typing and mis-stating their problem(s) in their frantic posts. :) "Jasper Mulder" wrote in message news:snt106-w65e964fcfdcf1ff338df0cf7...@phx.gbl... Personally, I think that incorrect spelling is far more annoying than the quoting; that is, if it does not originate from incapability due to English (whether it be British or American) being not the native language, as opposed to spelling errors because of vapidity. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] I want to use POST when redirect via PHP Header function.
> To: php-general@lists.php.net > From: jim.gi...@albanyhandball.com > Date: Thu, 30 Jun 2011 09:12:45 -0400 > Subject: Re: [PHP] I want to use POST when redirect via PHP Header function. > > Just as bottom posting (I know, it's in da rules) makes it rather difficult > for humans to read thru a topic, scrolling thru ever-longer messages to get > to the 'new' content. > > Let's solve it for all by only posting your own content and let the sum of > all the messages equate to the topic. :) In fact, the posting rules state that one should only quote those parts of a message that are relevant for the post. Unfortunately, many people decide that everything is relevant, even for a long thread. Still, this should not mean we have to flee to the opposite of no quoting. You will agree that quoting your message above will be clearer than just replying without quote. Personally, I think that incorrect spelling is far more annoying than the quoting; that is, if it does not originate from incapability due to English (whether it be British or American) being not the native language, as opposed to spelling errors because of vapidity. As for the readers of this list, I am sorry to go into this non-PHP subject, but I couldn't really let this pass. Best regards, Jasper
Re: [PHP] I want to use POST when redirect via PHP Header function.
Just as bottom posting (I know, it's in da rules) makes it rather difficult for humans to read thru a topic, scrolling thru ever-longer messages to get to the 'new' content. Let's solve it for all by only posting your own content and let the sum of all the messages equate to the topic. :) "Ashley Sheridan" wrote in message news:4ce7359b-95f0-4c51-8d23-078b4838f...@email.android.com... Ps. Could people please avoid top posting, as it does make it rather difficult for the automated archive and some screen readers. Thanks, Ash http://www.ashleysheridan.co.uk -- Sent from my Android phone with K-9 Mail. Please excuse my brevity. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] I want to use POST when redirect via PHP Header function.
Md Ashickur Rahman Noor wrote: >> >> On Thu, Jun 30, 2011 at 1:52 PM, Geoff Lane >wrote: >> On Thursday, June 30, 2011, Md Ashickur Rahman Noor wrote: >> >> > I want to use POST when redirect via PHP Header function. Is it >> > possible? >> >> AFAICT, it isn't. You can use GET variables by passing them on the >> querystring. These can then be accessed via $_REQUEST, which is an >> amalgamation of $_POST, $_GET, and $_COOKIE. So if you have a script >> that might take input from either $_POST or $_GET, you can usually >> code fairly transparently by replacing both by $_REQUEST. >> >> Alternatively, you can create a form on the page and use client-side >> javascript to 'auto-submit' via the body onLoad event. However, this >> does require JS on the client and so cannot be guaranteed. >> >> HTH, >> >> -- >> Geoff >> > >Thank you every one. If I use GET then the value will be shown in the >address bar, Which I don't want to do. > >Can any one describe me the $_REQUEST and $_COOKIE, if you can give >example >it will be helpful for me. >-- >Dedicated Linux Forum in >Bangladesh<http://forums.linuxdesh.com/member.php?action=register&referrer=3%20> >Follow Me Twiter <https://twitter.com/#%21/AshickunNoor> >Thank you >Md Ashickur Rahman If you issue a header("Location:") call then you can't use post. If you have to send back values that you don't want a user to see, why don't you build the page you are outputting and echo it out instead of issuing a whole redirect? That way, you can use hidden form elements to hold these values. If you just need values to be persistent, have a look at the $_SESSION array and session_start() which you can use for this. Thanks, Ash http://www.ashleysheridan.co.uk -- Sent from my Android phone with K-9 Mail. Please excuse my brevity. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] I want to use POST when redirect via PHP Header function.
that's quite basic thing which you can definitely find in the manual On 30 June 2011 10:48, Md Ashickur Rahman Noor wrote: > > > > On Thu, Jun 30, 2011 at 1:52 PM, Geoff Lane wrote: > > On Thursday, June 30, 2011, Md Ashickur Rahman Noor wrote: > > > > > I want to use POST when redirect via PHP Header function. Is it > > > possible? > > > > AFAICT, it isn't. You can use GET variables by passing them on the > > querystring. These can then be accessed via $_REQUEST, which is an > > amalgamation of $_POST, $_GET, and $_COOKIE. So if you have a script > > that might take input from either $_POST or $_GET, you can usually > > code fairly transparently by replacing both by $_REQUEST. > > > > Alternatively, you can create a form on the page and use client-side > > javascript to 'auto-submit' via the body onLoad event. However, this > > does require JS on the client and so cannot be guaranteed. > > > > HTH, > > > > -- > > Geoff > > > > Thank you every one. If I use GET then the value will be shown in the > address bar, Which I don't want to do. > > Can any one describe me the $_REQUEST and $_COOKIE, if you can give example > it will be helpful for me. > -- > Dedicated Linux Forum in > Bangladesh< > http://forums.linuxdesh.com/member.php?action=register&referrer=3%20> > Follow Me Twiter <https://twitter.com/#%21/AshickunNoor> > Thank you > Md Ashickur Rahman >
Re: [PHP] I want to use POST when redirect via PHP Header function.
> > On Thu, Jun 30, 2011 at 1:52 PM, Geoff Lane wrote: > On Thursday, June 30, 2011, Md Ashickur Rahman Noor wrote: > > > I want to use POST when redirect via PHP Header function. Is it > > possible? > > AFAICT, it isn't. You can use GET variables by passing them on the > querystring. These can then be accessed via $_REQUEST, which is an > amalgamation of $_POST, $_GET, and $_COOKIE. So if you have a script > that might take input from either $_POST or $_GET, you can usually > code fairly transparently by replacing both by $_REQUEST. > > Alternatively, you can create a form on the page and use client-side > javascript to 'auto-submit' via the body onLoad event. However, this > does require JS on the client and so cannot be guaranteed. > > HTH, > > -- > Geoff > Thank you every one. If I use GET then the value will be shown in the address bar, Which I don't want to do. Can any one describe me the $_REQUEST and $_COOKIE, if you can give example it will be helpful for me. -- Dedicated Linux Forum in Bangladesh<http://forums.linuxdesh.com/member.php?action=register&referrer=3%20> Follow Me Twiter <https://twitter.com/#%21/AshickunNoor> Thank you Md Ashickur Rahman
Re: [PHP] I want to use POST when redirect via PHP Header function.
On Thursday, June 30, 2011, Md Ashickur Rahman Noor wrote: > I want to use POST when redirect via PHP Header function. Is it > possible? AFAICT, it isn't. You can use GET variables by passing them on the querystring. These can then be accessed via $_REQUEST, which is an amalgamation of $_POST, $_GET, and $_COOKIE. So if you have a script that might take input from either $_POST or $_GET, you can usually code fairly transparently by replacing both by $_REQUEST. Alternatively, you can create a form on the page and use client-side javascript to 'auto-submit' via the body onLoad event. However, this does require JS on the client and so cannot be guaranteed. HTH, -- Geoff -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] I want to use POST when redirect via PHP Header function.
ad...@buskirkgraphics.com wrote: >I could be wrong on this but, >I am pretty sure you can use GET variables but not POST in a header >redirect. > >Example >header('Location:http://www.yourmom.com/?large=incharge&hasorbit=yes'); > > > > > >Richard L. Buskirk > >-Original Message- >From: Md Ashickur Rahman Noor [mailto:ashickur.n...@gmail.com] >Sent: Thursday, June 30, 2011 2:36 AM >To: Ashley Sheridan >Cc: php-general@lists.php.net >Subject: Re: [PHP] I want to use POST when redirect via PHP Header >function. > >For passing value to other page. >-- >Dedicated Linux Forum in >Bangladesh<http://forums.linuxdesh.com/member.php?action=register&referrer=3 >%20> >Follow Me Twiter <https://twitter.com/#%21/AshickunNoor> >Thank you >Md Ashickur Rahman > > > > >On Thu, Jun 30, 2011 at 12:34 PM, Ashley Sheridan >wrote: > >> >> >> Md Ashickur Rahman Noor wrote: >> >> >I want to use POST when redirect via PHP Header function. Is it >> >possible? >> >-- >> >Dedicated Linux Forum in >> >Bangladesh< >> http://forums.linuxdesh.com/member.php?action=register&referrer=3%20> >> >Follow Me Twiter <https://twitter.com/#%21/AshickunNoor> >> >Thank you >> >Md Ashickur Rahman >> >> Erm, a bit vague. Use POST for *what* during the redirect? >> >> Thanks, >> Ash >> http://www.ashleysheridan.co.uk >> -- >> Sent from my Android phone with K-9 Mail. Please excuse my brevity. >> > > >-- >PHP General Mailing List (http://www.php.net/) >To unsubscribe, visit: http://www.php.net/unsub.php Following on from what Richard said, the post data is part of a request made by a browser, not the response made by the server, which is what a header is, a response. Maybe you need to look into cURL, which make a request and forward the response on to the browser. Ps. Could people please avoid top posting, as it does make it rather difficult for the automated archive and some screen readers. Thanks, Ash http://www.ashleysheridan.co.uk -- Sent from my Android phone with K-9 Mail. Please excuse my brevity. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] I want to use POST when redirect via PHP Header function.
I could be wrong on this but, I am pretty sure you can use GET variables but not POST in a header redirect. Example header('Location:http://www.yourmom.com/?large=incharge&hasorbit=yes'); Richard L. Buskirk -Original Message- From: Md Ashickur Rahman Noor [mailto:ashickur.n...@gmail.com] Sent: Thursday, June 30, 2011 2:36 AM To: Ashley Sheridan Cc: php-general@lists.php.net Subject: Re: [PHP] I want to use POST when redirect via PHP Header function. For passing value to other page. -- Dedicated Linux Forum in Bangladesh<http://forums.linuxdesh.com/member.php?action=register&referrer=3 %20> Follow Me Twiter <https://twitter.com/#%21/AshickunNoor> Thank you Md Ashickur Rahman On Thu, Jun 30, 2011 at 12:34 PM, Ashley Sheridan wrote: > > > Md Ashickur Rahman Noor wrote: > > >I want to use POST when redirect via PHP Header function. Is it > >possible? > >-- > >Dedicated Linux Forum in > >Bangladesh< > http://forums.linuxdesh.com/member.php?action=register&referrer=3%20> > >Follow Me Twiter <https://twitter.com/#%21/AshickunNoor> > >Thank you > >Md Ashickur Rahman > > Erm, a bit vague. Use POST for *what* during the redirect? > > Thanks, > Ash > http://www.ashleysheridan.co.uk > -- > Sent from my Android phone with K-9 Mail. Please excuse my brevity. > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] I want to use POST when redirect via PHP Header function.
For passing value to other page. -- Dedicated Linux Forum in Bangladesh<http://forums.linuxdesh.com/member.php?action=register&referrer=3%20> Follow Me Twiter <https://twitter.com/#%21/AshickunNoor> Thank you Md Ashickur Rahman On Thu, Jun 30, 2011 at 12:34 PM, Ashley Sheridan wrote: > > > Md Ashickur Rahman Noor wrote: > > >I want to use POST when redirect via PHP Header function. Is it > >possible? > >-- > >Dedicated Linux Forum in > >Bangladesh< > http://forums.linuxdesh.com/member.php?action=register&referrer=3%20> > >Follow Me Twiter <https://twitter.com/#%21/AshickunNoor> > >Thank you > >Md Ashickur Rahman > > Erm, a bit vague. Use POST for *what* during the redirect? > > Thanks, > Ash > http://www.ashleysheridan.co.uk > -- > Sent from my Android phone with K-9 Mail. Please excuse my brevity. >
Re: [PHP] I want to use POST when redirect via PHP Header function.
Md Ashickur Rahman Noor wrote: >I want to use POST when redirect via PHP Header function. Is it >possible? >-- >Dedicated Linux Forum in >Bangladesh<http://forums.linuxdesh.com/member.php?action=register&referrer=3%20> >Follow Me Twiter <https://twitter.com/#%21/AshickunNoor> >Thank you >Md Ashickur Rahman Erm, a bit vague. Use POST for *what* during the redirect? Thanks, Ash http://www.ashleysheridan.co.uk -- Sent from my Android phone with K-9 Mail. Please excuse my brevity. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] I want to use POST when redirect via PHP Header function.
I want to use POST when redirect via PHP Header function. Is it possible? -- Dedicated Linux Forum in Bangladesh<http://forums.linuxdesh.com/member.php?action=register&referrer=3%20> Follow Me Twiter <https://twitter.com/#%21/AshickunNoor> Thank you Md Ashickur Rahman
RE: [PHP] header function odd behavior
> -Original Message- > From: H Rao [mailto:hydsd...@gmail.com] > Sent: 28 June 2011 04:40 > > I am trying to understand odd(different) behavior of the header > function > under two different environments. > > Here is the code which I am trying to execute from two different > servers > > header ("Set-Cookie: c1=value1;path=/; domain=.domain.com"); > header ("Set-Cookie: c2=value2;path=/; domain=.domain.com"); > ?> > > When executed from server1(OS X), both cookies are set in browser, > but when > executed from server2(Linux), only the second cookie is set. > > server1 and server2 are running different OS and php version as > below. I > know I could add $replace=false option on the Linux server, but I am > trying > to understand the different behavior of header() function on these > two > servers. Any thoughts? Well, according to the manual, you need to be using the FALSE parameter anyway since "By default it will replace, but if you pass in FALSE as the second argument you can force multiple headers". So the wrong behaviour is on the (older) OS X server, but I'm as confused as you as to why this should be as there is no indication in the manual or the ChangeLog that the default behaviour has changed at any point. Cheers! Mike -- Mike Ford, Electronic Information Developer, Libraries and Learning Innovation, Leeds Metropolitan University, Portland PD507, City Campus, Portland Way, LEEDS, LS1 3HE, United Kingdom E: m.f...@leedsmet.ac.uk T: +44 113 812 4730 To view the terms under which this email is distributed, please go to http://disclaimer.leedsmet.ac.uk/email.htm -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] header function odd behavior
On 06/28/2011 09:10 AM, H Rao wrote: > Hi, > > I am trying to understand odd(different) behavior of the header function > under two different environments. > > Here is the code which I am trying to execute from two different servers > > header ("Set-Cookie: c1=value1;path=/; domain=.domain.com"); > header ("Set-Cookie: c2=value2;path=/; domain=.domain.com"); > ?> > > When executed from server1(OS X), both cookies are set in browser, but when > executed from server2(Linux), only the second cookie is set. > > server1 and server2 are running different OS and php version as below. I > know I could add $replace=false option on the Linux server, but I am trying > to understand the different behavior of header() function on these two > servers. Any thoughts? > I don't have a clear idea about this because I always use setcookie(), but something tells me that this has something to do with output buffering and friends. -- Regards, Nilesh Govindarajan @nileshgr -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] header function odd behavior
Hi, I am trying to understand odd(different) behavior of the header function under two different environments. Here is the code which I am trying to execute from two different servers When executed from server1(OS X), both cookies are set in browser, but when executed from server2(Linux), only the second cookie is set. server1 and server2 are running different OS and php version as below. I know I could add $replace=false option on the Linux server, but I am trying to understand the different behavior of header() function on these two servers. Any thoughts? server1 - OS X -- PHP Version 5.2.4 System Darwin host2.domain.com 8.8.4 Darwin Kernel Version 8.8.4: Sun Oct 29 15:26:54 PST 2006; root:xnu-792.16.4.obj~1/RELEASE_I386 i386 -- server2 - Linux -- PHP Version 5.3.5 System Linux host1.domain.com 2.6.18-164.15.1.0.1.el5 #1 SMP Wed Mar 17 01:10:06 EDT 2010 x86_64 -Rao
Re: [PHP] Header function
On Mon, 2010-03-01 at 12:14 +0100, Kim Madsen wrote: > Ashley Sheridan wrote on 01/03/2010 07:13: > > > The HTTP header doesn't treat quoteation marks in the same way that PHP > > does. It needs double quote marks to function correctly. > > How do you mean? And do you have a link to this information? > > Even if this is true, then the first Nick did should still be correct? > > header('Content-Disposition: attachment; filename="PurchaseReq.doc"'); > > I'm using the same headers for downloads, allthough I use double qoutes > for the header function aswell: > > header("Content-Disposition: attachment; filename=\"artist - title.mp3\""); > > -- > Kind regards > Kim Emax - masterminds.dk > I only meant for the quotes around the filename. I'd tried header("Content-Disposition: attachment; filename='artist - title.mp3'"); before and it didn't work correctly. I hadn't run into the problem of double quotes inside singe though, as the filenames I was generating relied on a variable, and I found it easier to just escape the second set of nested quotes and include the variable directly. As far as I'm aware, the header() function shouldn't care whether it uses single or double quotes, so I would assume it's something else amiss. Thanks, Ash http://www.ashleysheridan.co.uk
Re: [PHP] Header function
Ashley Sheridan wrote on 01/03/2010 07:13: The HTTP header doesn't treat quoteation marks in the same way that PHP does. It needs double quote marks to function correctly. How do you mean? And do you have a link to this information? Even if this is true, then the first Nick did should still be correct? header('Content-Disposition: attachment; filename="PurchaseReq.doc"'); I'm using the same headers for downloads, allthough I use double qoutes for the header function aswell: header("Content-Disposition: attachment; filename=\"artist - title.mp3\""); -- Kind regards Kim Emax - masterminds.dk -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Header function
On Sat, 2010-02-27 at 23:48 +1100, Nick allan wrote: > Interesting the following works > Changing the " to '. If I leave the ' around the filename, the ' becomes part > of the filename. But it seemed to be more about changing the surrounding ' to > " that fixed it. Not sure why this is, but its working now. > > > header('Content-Type: application/msword'); > header("Content-Disposition: attachment; filename=PurchaseReq.doc"); > -Original Message- > From: Richard Quadling [mailto:rquadl...@googlemail.com] > Sent: Saturday, 27 February 2010 8:45 PM > To: Nick allan > Cc: php-general@lists.php.net > Subject: Re: [PHP] Header function > > On 27 February 2010 04:32, Nick allan wrote: > > Hi all > > > > Has anyone got any ideas why the following isn't giving me correct filename > > in the ie save dialogue > > > > header('Content-Type: application/msword'); > > > > header('Content-Disposition: attachment; filename="PurchaseReq.doc"'); > > > > > > > > I get the save dialogue, but with preq.doc instead of PurchaseReq.doc > > > > Preq.php is the calling php file. It has worked before so I'm not sure what > > I've changed to have it stop working. > > > > > > > > > > > > Thanks in advance for any suggestions. > > > > > > > > Regards Nick > > > > > > > > > > What happens if you drop the quotes around the filename? > > -- > - > Richard Quadling > "Standing on the shoulders of some very clever giants!" > EE : http://www.experts-exchange.com/M_248814.html > EE4Free : http://www.experts-exchange.com/becomeAnExpert.jsp > Zend Certified Engineer : http://zend.com/zce.php?c=ZEND002498&r=213474731 > ZOPA : http://uk.zopa.com/member/RQuadling > > The HTTP header doesn't treat quoteation marks in the same way that PHP does. It needs double quote marks to function correctly. Thanks, Ash http://www.ashleysheridan.co.uk
RE: [PHP] Header function
Interesting the following works Changing the " to '. If I leave the ' around the filename, the ' becomes part of the filename. But it seemed to be more about changing the surrounding ' to " that fixed it. Not sure why this is, but its working now. header('Content-Type: application/msword'); header("Content-Disposition: attachment; filename=PurchaseReq.doc"); -Original Message- From: Richard Quadling [mailto:rquadl...@googlemail.com] Sent: Saturday, 27 February 2010 8:45 PM To: Nick allan Cc: php-general@lists.php.net Subject: Re: [PHP] Header function On 27 February 2010 04:32, Nick allan wrote: > Hi all > > Has anyone got any ideas why the following isn't giving me correct filename > in the ie save dialogue > > header('Content-Type: application/msword'); > > header('Content-Disposition: attachment; filename="PurchaseReq.doc"'); > > > > I get the save dialogue, but with preq.doc instead of PurchaseReq.doc > > Preq.php is the calling php file. It has worked before so I'm not sure what > I've changed to have it stop working. > > > > > > Thanks in advance for any suggestions. > > > > Regards Nick > > > > What happens if you drop the quotes around the filename? -- - Richard Quadling "Standing on the shoulders of some very clever giants!" EE : http://www.experts-exchange.com/M_248814.html EE4Free : http://www.experts-exchange.com/becomeAnExpert.jsp Zend Certified Engineer : http://zend.com/zce.php?c=ZEND002498&r=213474731 ZOPA : http://uk.zopa.com/member/RQuadling -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Header function
On 27 February 2010 04:32, Nick allan wrote: > Hi all > > Has anyone got any ideas why the following isn't giving me correct filename > in the ie save dialogue > > header('Content-Type: application/msword'); > > header('Content-Disposition: attachment; filename="PurchaseReq.doc"'); > > > > I get the save dialogue, but with preq.doc instead of PurchaseReq.doc > > Preq.php is the calling php file. It has worked before so I'm not sure what > I've changed to have it stop working. > > > > > > Thanks in advance for any suggestions. > > > > Regards Nick > > > > What happens if you drop the quotes around the filename? -- - Richard Quadling "Standing on the shoulders of some very clever giants!" EE : http://www.experts-exchange.com/M_248814.html EE4Free : http://www.experts-exchange.com/becomeAnExpert.jsp Zend Certified Engineer : http://zend.com/zce.php?c=ZEND002498&r=213474731 ZOPA : http://uk.zopa.com/member/RQuadling -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Header function
Hi all Has anyone got any ideas why the following isn't giving me correct filename in the ie save dialogue header('Content-Type: application/msword'); header('Content-Disposition: attachment; filename="PurchaseReq.doc"'); I get the save dialogue, but with preq.doc instead of PurchaseReq.doc Preq.php is the calling php file. It has worked before so I'm not sure what I've changed to have it stop working. Thanks in advance for any suggestions. Regards Nick
Re: [PHP] header function query
output the html you want to send afterwards first, then either put a link to another script that outputs the word file, or have an auto-launch ajax routine (i recommend jquery.com for ajax) do it automatically. On Fri, Feb 26, 2010 at 7:49 AM, Nick allan wrote: > Hi all > > The situation is as follows > > I've read some data in from a couple of files into a string variable, made > some changes to it and want to send the contents of the string out to the > browser as a word document. > > My code currently looks like the following > > header('Content-Type: application/msword'); > > header('Content-Disposition: attachment; > filename="preq.doc"'); > > ob_clean(); > > echo $allText; > > > > > > The above code works fine, the client gets a file download dialogue and can > save or open the file. > > How can I indicate end of file, then continue writing html to display a new > page. I want to be able to ask the user some additional questions after they > have downloaded the file. My problem is that if I add any html code after > the above echo statement, it is included in the downloaded file. > > There's probably a simple answer to this, but I haven't been able to find > anything using google. > > > > Thanks in advance for any suggestions. > > > > Regards Nick > > > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] header function query
On 26 February 2010 06:49, Nick allan wrote: > Hi all > > The situation is as follows > > I've read some data in from a couple of files into a string variable, made > some changes to it and want to send the contents of the string out to the > browser as a word document. > > My code currently looks like the following > > header('Content-Type: application/msword'); > > header('Content-Disposition: attachment; > filename="preq.doc"'); > > ob_clean(); > > echo $allText; > > > > > > The above code works fine, the client gets a file download dialogue and can > save or open the file. > > How can I indicate end of file, then continue writing html to display a new > page. I want to be able to ask the user some additional questions after they > have downloaded the file. My problem is that if I add any html code after > the above echo statement, it is included in the downloaded file. > > There's probably a simple answer to this, but I haven't been able to find > anything using google. > > > > Thanks in advance for any suggestions. > > > > Regards Nick > > > > Under normal conditions, you can't. A request is for a single thing. While it is potentially possible to embed graphics, css, js into a single html file request, downloading files is not. Instead, you issue the html first, but include in the tag, a redirect tag to the URL just for the download file. -- - Richard Quadling "Standing on the shoulders of some very clever giants!" EE : http://www.experts-exchange.com/M_248814.html EE4Free : http://www.experts-exchange.com/becomeAnExpert.jsp Zend Certified Engineer : http://zend.com/zce.php?c=ZEND002498&r=213474731 ZOPA : http://uk.zopa.com/member/RQuadling -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] header function query
Hi all The situation is as follows I've read some data in from a couple of files into a string variable, made some changes to it and want to send the contents of the string out to the browser as a word document. My code currently looks like the following header('Content-Type: application/msword'); header('Content-Disposition: attachment; filename="preq.doc"'); ob_clean(); echo $allText; The above code works fine, the client gets a file download dialogue and can save or open the file. How can I indicate end of file, then continue writing html to display a new page. I want to be able to ask the user some additional questions after they have downloaded the file. My problem is that if I add any html code after the above echo statement, it is included in the downloaded file. There's probably a simple answer to this, but I haven't been able to find anything using google. Thanks in advance for any suggestions. Regards Nick
Re: [PHP] redirecting to another frame using php header function
> hi... > > can anyone point me to a way to do a page redirect using the php 'Header' > function to another frame. I have a page in one frame, when the user does > a > submit, i want to have the app do a redirect using the 'Header' function, > with the subsequent page being displayed in another frame. > > didn't find anything from google/php.net > > thanks > > -bruce Javascript, javascript, javascript. If you want the browser to do something, use client-side instructions. If you want the server to do something, use server-side instructions. A header simply sends, well, HTTP headers. You're asking the browser to reload a frame which is different. -- --Matthew Sims --<http://killermookie.org> -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] redirecting to another frame using php header function
bruce wrote: can anyone point me to a way to do a page redirect using the php 'Header' function to another frame. No. Use Javascript. -- John Holmes php|architect - The magazine for PHP professionals - http://www.phparch.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] redirecting to another frame using php header function
bruce wrote: hi... can anyone point me to a way to do a page redirect using the php 'Header' function to another frame. I have a page in one frame, when the user does a submit, i want to have the app do a redirect using the 'Header' function, with the subsequent page being displayed in another frame. didn't find anything from google/php.net Can't do this with php. -- John C. Nichel ÜberGeek KegWorks.com 716.856.9675 [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] redirecting to another frame using php header function
hi... can anyone point me to a way to do a page redirect using the php 'Header' function to another frame. I have a page in one frame, when the user does a submit, i want to have the app do a redirect using the 'Header' function, with the subsequent page being displayed in another frame. didn't find anything from google/php.net thanks -bruce -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] header function, I'm stumped
-- Jon Kriek www.phpfreaks.com www.jonkriek.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] header function, I'm stumped
--- Kelly Hallman <[EMAIL PROTECTED]> wrote: > On Tue, 2 Dec 2003, Chris Hubbard wrote: > > All, dealing with header("location:...") again. and trying to > > understand what's happening. I've got the following code: > > header("Location:http://www.mysite.com/cp/ad/ad_details.php?id=";. > $id); > > I'm kinda surprised I didn't see this mentioned.. Have you tried: > header("Location: http://url.redirect/\n\n";); exit; // ? You should definitely not try to add your own newlines to the end of a header like that. PHP might be able to gracefully handle it, but I wouldn't rely on it. As for the original question, put a space after your colon, and let us know how that works. Hope that helps. Chris = Chris Shiflett - http://shiflett.org/ PHP Security Handbook Coming mid-2004 HTTP Developer's Handbook http://httphandbook.org/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] header function, I'm stumped
On Tue, 2 Dec 2003, Chris Hubbard wrote: > All, dealing with header("location:...") again. and trying to > understand what's happening. I've got the following code: > header("Location:http://www.mysite.com/cp/ad/ad_details.php?id=";. $id); I'm kinda surprised I didn't see this mentioned.. Have you tried: header("Location: http://url.redirect/\n\n";); exit; // ? The browser may be particular about the headers. When you add the two newlines to the end, it makes it look like the end of the headers. It's good practice to explicitly exit each time you redirect. -- Kelly Hallman // Ultrafancy -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] header function, I'm stumped
--- Chris Hubbard <[EMAIL PROTECTED]> wrote: > header("Location:http://www.mysite.com/cp/ad/ad_details.php?id=";. $id); There should be a space after the first colon there. > Then I used LiveHTTPHeaders in Mozilla and it give me some interesting > information, though I'm not quite sure how to interpret. Awesome. Paste that here (you can omit the bulk of the HTML, so that there's not too much stuff to sift through), and we can help you interpret it. What would be best is to try and trim it down to only what is different between when it works and when it doesn't. Chris = Chris Shiflett - http://shiflett.org/ PHP Security Handbook Coming mid-2004 HTTP Developer's Handbook http://httphandbook.org/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] header function, I'm stumped
All, dealing with header("location:...") again. and trying to understand what's happening. I've got the following code: writeMessage($id); header("Location:http://www.mysite.com/cp/ad/ad_details.php?id=";. $id); writeMessage() is a debugging function that writes the value of the variable to a debug log. When the code is run $id does have a valid value like 8 or 12. When I run the code, it does not redirect to the specified location, it continues executing the code. So I add the exit; and it does work: writeMessage($id); header("Location:http://www.mysite.com/cp/ad/ad_details.php?id=";. $id); exit; What's weird is the same code without the exit works on a different server (and indeed the same code with different location works on this server) I thought perhaps it was due to type problem, but code doesn't work if $id is a string or integer. The flow for the code: start the edit page when edit page is submitted, check the data, if data is good, update the database redirect to details page if data is bad, return to the edit page Then I used LiveHTTPHeaders in Mozilla and it give me some interesting information, though I'm not quite sure how to interpret. Can someone provide some depth to the mechanisms within the header(location)? Thanks in advance, Chris Hubbard [EMAIL PROTECTED] www.wildcharacters.com 425 481 2020 php based web application development [[ check out phalidate, a data validation class ]] Y! [EMAIL PROTECTED] MSN [EMAIL PROTECTED] AIM ganeshacph -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] php header function
--- Shaun van den Berg <[EMAIL PROTECTED]> wrote: > I have tried the net , googling ect. but i cannot get a good > description of what the header function is al about ? Can anyone > please define the header function. It allows you to specify an HTTP header to be included in the response to the Web client. You can find more information specifically about header at: http://www.php.net/header If you want to know more about HTTP itself, and the valid headers, you can buy HTTP Developer's Handbook. :-) Or, if you want to research the various specifications yourself, I link to many of them from here: http://shiflett.org/docs Hope that helps. Chris = My Blog http://shiflett.org/ HTTP Developer's Handbook http://httphandbook.org/ RAMP Training Courses http://www.nyphp.org/ramp -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] php header function
http://uk.php.net/header Have a look at that. As it says, sends an HTTP header. Useful if you want to specify content type in the page that isn't HTML (maybe an image or a pdf). Read the above for more info. Regards Chris -Original Message- From: Shaun van den Berg [mailto:[EMAIL PROTECTED] Sent: 24 October 2003 09:47 To: [EMAIL PROTECTED] Subject: [PHP] php header function Hi I have tried the net , googling ect. but i cannot get a good description of what the header function is al about ? Can anyone please define the header function. Thanks Shaun -- Novtel Consulting Tel: +27 21 9822373 Fax: +27 21 9815846 Please visit our website: www.novtel.co.za -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php If you are not the intended recipient of this e-mail, please preserve the confidentiality of it and advise the sender immediately of any error in transmission. Any disclosure, copying, distribution or action taken, or omitted to be taken, by an unauthorised recipient in reliance upon the contents of this e-mail is prohibited. Somerfield cannot accept liability for any damage which you may sustain as a result of software viruses so please carry out your own virus checks before opening an attachment. In replying to this e-mail you are granting the right for that reply to be forwarded to any other individual within the business and also to be read by others. Any views expressed by an individual within this message do not necessarily reflect the views of Somerfield. Somerfield reserves the right to intercept, monitor and record communications for lawful business purposes. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] php header function
Hi I have tried the net , googling ect. but i cannot get a good description of what the header function is al about ? Can anyone please define the header function. Thanks Shaun -- Novtel Consulting Tel: +27 21 9822373 Fax: +27 21 9815846 Please visit our website: www.novtel.co.za -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] header() function...
We've just moved sites, to a new URL... on the home page of the old url, I simply had a page that was; http://www.newsite.com); ?> All good, any requests to that page, were cleanly redirected to the new site. I know this cause I tested it many times... Now on the stats for the new site, we can record no referals from http://www.oldsite.com yet I know I (and my co-workers) went to http://www.oldsite.com and got redirected to http://www.newsite.com Can someone confirm: Does this method or redirection interfere with the web server logging visits? Cheers, Tris... * The information contained in this e-mail message is intended only for the personal and confidential use of the recipient(s) named above. If the reader of this message is not the intended recipient or an agent responsible for delivering it to the intended recipient, you are hereby notified that you have received this document in error and that any review, dissemination, distribution, or copying of this message is strictly prohibited. If you have received this communication in error, please notify us immediately by e-mail, and delete the original message. ***
Re: [PHP] header() function for displaying an opened PDF document.
Sound like a good idea. I'll see if I can find this on the Internet and see what happen. "Bertrand Moulard" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > now that I'm rethinking of it, I solved the problem by using the brilliant > python program tcpwatch, which logs all the http data going in and out your > browser. Very easy to run and so handy (not only for this problem). Would > find the url for dld if you want. > > cheers > > .b > > -Original Message- > From: Scott Fletcher [mailto:[EMAIL PROTECTED] > Sent: 13 October 2003 22:15 > To: [EMAIL PROTECTED] > Subject: [PHP] header() function for displaying an opened PDF document. > > > I seem to be having problem with sending the PDF document to the browser to > be open on screen. I kept getting the error message, it say 'Windows cannot > open this file'. Here's my sample script, so what am I doing wrong?... > > --snip-- > header("Content-Type: application/pdf"); > header("Content-Length: '40736'"); > header("Content-Disposition: inline; filename='junk.pdf'"); > --snip-- > > Thanks, > Scott F. > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] header() function for displaying an opened PDF document.
Not using the session. :-) Oh well... "Marek Kilimajer" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Are you using sessions? Then you need > session_cache_limiter('private_no_expire'); > > Scott Fletcher wrote: > > > I seem to be having problem with sending the PDF document to the browser to > > be open on screen. I kept getting the error message, it say 'Windows cannot > > open this file'. Here's my sample script, so what am I doing wrong?... > > > > --snip-- > > header("Content-Type: application/pdf"); > > header("Content-Length: '40736'"); > > header("Content-Disposition: inline; filename='junk.pdf'"); > > --snip-- > > > > Thanks, > > Scott F. > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] header() function for displaying an opened PDF document.
Are you using sessions? Then you need session_cache_limiter('private_no_expire'); Scott Fletcher wrote: I seem to be having problem with sending the PDF document to the browser to be open on screen. I kept getting the error message, it say 'Windows cannot open this file'. Here's my sample script, so what am I doing wrong?... --snip-- header("Content-Type: application/pdf"); header("Content-Length: '40736'"); header("Content-Disposition: inline; filename='junk.pdf'"); --snip-- Thanks, Scott F. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] header() function for displaying an opened PDF document.
now that I'm rethinking of it, I solved the problem by using the brilliant python program tcpwatch, which logs all the http data going in and out your browser. Very easy to run and so handy (not only for this problem). Would find the url for dld if you want. cheers .b -Original Message- From: Scott Fletcher [mailto:[EMAIL PROTECTED] Sent: 13 October 2003 22:15 To: [EMAIL PROTECTED] Subject: [PHP] header() function for displaying an opened PDF document. I seem to be having problem with sending the PDF document to the browser to be open on screen. I kept getting the error message, it say 'Windows cannot open this file'. Here's my sample script, so what am I doing wrong?... --snip-- header("Content-Type: application/pdf"); header("Content-Length: '40736'"); header("Content-Disposition: inline; filename='junk.pdf'"); --snip-- Thanks, Scott F. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] header() function for displaying an opened PDF document.
Might not be connected at all, but I had a similar problem with pdf stored in a postgreSQL database as large object. The content type was set to pdf, but ie wouldn't open it. It turned up that it was because there was a CRLF at the end of one of my script, which spoiled the whole output. Pretty dumb thing, but it kept me busy for a good hour. If you're desperate for a solution, look for an unwanted new line somewhere in your file out of the tags. good luck .b -Original Message- From: Scott Fletcher [mailto:[EMAIL PROTECTED] Sent: 13 October 2003 22:15 To: [EMAIL PROTECTED] Subject: [PHP] header() function for displaying an opened PDF document. I seem to be having problem with sending the PDF document to the browser to be open on screen. I kept getting the error message, it say 'Windows cannot open this file'. Here's my sample script, so what am I doing wrong?... --snip-- header("Content-Type: application/pdf"); header("Content-Length: '40736'"); header("Content-Disposition: inline; filename='junk.pdf'"); --snip-- Thanks, Scott F. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] header() function for displaying an opened PDF document.
I seem to be having problem with sending the PDF document to the browser to be open on screen. I kept getting the error message, it say 'Windows cannot open this file'. Here's my sample script, so what am I doing wrong?... --snip-- header("Content-Type: application/pdf"); header("Content-Length: '40736'"); header("Content-Disposition: inline; filename='junk.pdf'"); --snip-- Thanks, Scott F. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] header function problem
It works now. Are their any examples out there that will show how to pass back the information that was entered and pass the error message back to the form.htm ? Or a function that i need to read up on. -Dan - Original Message - From: "Jason Wong" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Thursday, June 05, 2003 1:01 AM Subject: Re: [PHP] header function problem > On Thursday 05 June 2003 07:01, Daniel J. Rychlik wrote: > > Well, it works if I use the full path instead of relative So obviously > > its an apache permissions issue. > > It has nothing to do with apache. The specs require that the location is > absolute. > > -- > Jason Wong -> Gremlins Associates -> www.gremlins.biz > Open Source Software Systems Integrators > * Web Design & Hosting * Internet & Intranet Applications Development * > -- > Search the list archives before you post > http://marc.theaimsgroup.com/?l=php-general > -- > /* > It is undignified for a woman to play servant to a man who is not hers. > -- Spock, "Amok Time", stardate 3372.7 > */ > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] header function problem
On Thursday 05 June 2003 07:01, Daniel J. Rychlik wrote: > Well, it works if I use the full path instead of relative So obviously > its an apache permissions issue. It has nothing to do with apache. The specs require that the location is absolute. -- Jason Wong -> Gremlins Associates -> www.gremlins.biz Open Source Software Systems Integrators * Web Design & Hosting * Internet & Intranet Applications Development * -- Search the list archives before you post http://marc.theaimsgroup.com/?l=php-general -- /* It is undignified for a woman to play servant to a man who is not hers. -- Spock, "Amok Time", stardate 3372.7 */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] header function problem
Well, it works if I use the full path instead of relative So obviously its an apache permissions issue. - Original Message - From: "Daniel J. Rychlik" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Wednesday, June 04, 2003 5:36 PM Subject: [PHP] header function problem I am using a header function to take a user back to a form if they have mistyped or entered in data that is not desirable. I have multiple functions that Ive written but the one that pertains to this situation is listed function check_data () { if (!empty($value)) { go_back(" blah "); } } function go_back($err) { header("Location: http://webserver/form.htm";); } When calling this, I recieved a 403 Forbidden error message. Obviously Im doing something wrong... Or I have a permissions issue. I would not think its a permissions issue execpt the way the header function calls. I honestly dont know, just guessing. I was wandering if anyone has seen this when using the header() function Thanks so much, Daniel -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] header function problem
I am using a header function to take a user back to a form if they have mistyped or entered in data that is not desirable. I have multiple functions that Ive written but the one that pertains to this situation is listed function check_data () { if (!empty($value)) { go_back(" blah "); } } function go_back($err) { header("Location: http://webserver/form.htm";); } When calling this, I recieved a 403 Forbidden error message. Obviously Im doing something wrong... Or I have a permissions issue. I would not think its a permissions issue execpt the way the header function calls. I honestly dont know, just guessing. I was wandering if anyone has seen this when using the header() function Thanks so much, Daniel
Re: [PHP] header function
AHA! Thank you! Barry At 01:38 PM 3/10/2003, you wrote: Use INCLUDE(), not virtual(). virtual() isn't supposed to be used with PHP files. ---John Holmes... - Original Message - From: "Barry Gould" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Monday, March 10, 2003 4:26 PM Subject: Re: [PHP] header function > I'm starting to think this is a BUG. > > Can anyone else test this and confirm or contradict? > > Thanks, > Barry > > At 03:35 PM 3/7/2003, you wrote: > >I am having a hard time with the header("Location:") function inside an > >include file with PHP 4.3.1 (Linux, running as a module w/ Apache 1.3.27). > > > >At the VERY TOP of my php page, I have: > > > > > >logincheck.php contains exactly: > > >// login check > >if(!isset($_SESSION["agent_id"])) > >{ > > header("Location:/"); > > header("Connection: close"); > > exit; > >} > >?> > > > >However, if this "agent_id" is not set, I just get a blank page with html > >open and close tags. > > > >I'm SURE there are no spaces or blank lines before these lines. > > > >It works fine if I put the code in the main page instead of using the > >virtual include. > > > >Output buffering is set to 4096 in php.ini. > > > >Any suggestions would be appreciated. > > > >Thanks, > >Barry > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] header function
Use INCLUDE(), not virtual(). virtual() isn't supposed to be used with PHP files. ---John Holmes... - Original Message - From: "Barry Gould" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Monday, March 10, 2003 4:26 PM Subject: Re: [PHP] header function > I'm starting to think this is a BUG. > > Can anyone else test this and confirm or contradict? > > Thanks, > Barry > > At 03:35 PM 3/7/2003, you wrote: > >I am having a hard time with the header("Location:") function inside an > >include file with PHP 4.3.1 (Linux, running as a module w/ Apache 1.3.27). > > > >At the VERY TOP of my php page, I have: > > > > > >logincheck.php contains exactly: > > >// login check > >if(!isset($_SESSION["agent_id"])) > >{ > > header("Location:/"); > > header("Connection: close"); > > exit; > >} > >?> > > > >However, if this "agent_id" is not set, I just get a blank page with html > >open and close tags. > > > >I'm SURE there are no spaces or blank lines before these lines. > > > >It works fine if I put the code in the main page instead of using the > >virtual include. > > > >Output buffering is set to 4096 in php.ini. > > > >Any suggestions would be appreciated. > > > >Thanks, > >Barry > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] header function
I'm starting to think this is a BUG. Can anyone else test this and confirm or contradict? Thanks, Barry At 03:35 PM 3/7/2003, you wrote: I am having a hard time with the header("Location:") function inside an include file with PHP 4.3.1 (Linux, running as a module w/ Apache 1.3.27). At the VERY TOP of my php page, I have: logincheck.php contains exactly: However, if this "agent_id" is not set, I just get a blank page with html open and close tags. I'm SURE there are no spaces or blank lines before these lines. It works fine if I put the code in the main page instead of using the virtual include. Output buffering is set to 4096 in php.ini. Any suggestions would be appreciated. Thanks, Barry -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] header function
I have session auto start on. Plus, like I said, it works fine if it's at the top of the page, not in the include file. Thanks, Barry At 05:19 PM 3/7/2003, Jim Lucas wrote: if you put this at the very to of the page, I am guessing then that you haven't ran session_start() ?? if you are trying to access a value stored in a session variable, you need to initialize the session first, then access the variable. Jim - Original Message - From: "Barry Gould" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Friday, March 07, 2003 3:35 PM Subject: [PHP] header function > I am having a hard time with the header("Location:") function inside an > include file with PHP 4.3.1 (Linux, running as a module w/ Apache 1.3.27). > > At the VERY TOP of my php page, I have: > > > logincheck.php contains exactly: > // login check > if(!isset($_SESSION["agent_id"])) > { > header("Location:/"); > header("Connection: close"); > exit; > } > ?> > > However, if this "agent_id" is not set, I just get a blank page with html > open and close tags. > > I'm SURE there are no spaces or blank lines before these lines. > > It works fine if I put the code in the main page instead of using the > virtual include. > > Output buffering is set to 4096 in php.ini. > > Any suggestions would be appreciated. > > Thanks, > Barry > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] header function
if you put this at the very to of the page, I am guessing then that you haven't ran session_start() ?? if you are trying to access a value stored in a session variable, you need to initialize the session first, then access the variable. Jim - Original Message - From: "Barry Gould" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Friday, March 07, 2003 3:35 PM Subject: [PHP] header function > I am having a hard time with the header("Location:") function inside an > include file with PHP 4.3.1 (Linux, running as a module w/ Apache 1.3.27). > > At the VERY TOP of my php page, I have: > > > logincheck.php contains exactly: > // login check > if(!isset($_SESSION["agent_id"])) > { > header("Location:/"); > header("Connection: close"); > exit; > } > ?> > > However, if this "agent_id" is not set, I just get a blank page with html > open and close tags. > > I'm SURE there are no spaces or blank lines before these lines. > > It works fine if I put the code in the main page instead of using the > virtual include. > > Output buffering is set to 4096 in php.ini. > > Any suggestions would be appreciated. > > Thanks, > Barry > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] header function
I am having a hard time with the header("Location:") function inside an include file with PHP 4.3.1 (Linux, running as a module w/ Apache 1.3.27). At the VERY TOP of my php page, I have: logincheck.php contains exactly: However, if this "agent_id" is not set, I just get a blank page with html open and close tags. I'm SURE there are no spaces or blank lines before these lines. It works fine if I put the code in the main page instead of using the virtual include. Output buffering is set to 4096 in php.ini. Any suggestions would be appreciated. Thanks, Barry -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] header function
At 20:47 09.11.2002, Donahue Ben said: [snip] >I am using the header function what i have is this: > >header("Location: >http://".$_SERVER['HTTP_HOST'].dirname($_SERVER['PHP_SELF'])."/".$relative_url > >$relative_url is a php file > >when i run this script with this header function in >it, i get an error saying:"Redirection limit for this >URL has exceeded. Unable to load the requested page." [snip] This message might mean that $relative_url points to the same script... what browser make&model are you using? IE simply loops, without any error. A small glitch: in case dirname($_SERVER['PHP_SELF']) is empty (root directory), your header would look as: http://www.yourdomain.com//relative.php Note the double slash... -- >O Ernest E. Vogelsinger (\)ICQ #13394035 ^ http://www.vogelsinger.at/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] header function
The file loading may be too long for PHP to recognize it or whatever. Try shortening it in some way. - Original Message - From: "Donahue Ben" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Saturday, November 09, 2002 2:47 PM Subject: [PHP] header function > I am using the header function what i have is this: > > header("Location: > http://".$_SERVER['HTTP_HOST'].dirname($_SERVER['PHP_SELF'])."/".$relative_u rl > > $relative_url is a php file > > when i run this script with this header function in > it, i get an error saying:"Redirection limit for this > URL has exceeded. Unable to load the requested page." > > I dont understand why i get this error and how to fix > this. > > Ben > > __ > Do you Yahoo!? > U2 on LAUNCH - Exclusive greatest hits videos > http://launch.yahoo.com/u2 > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] header function
I am using the header function what i have is this: header("Location: http://".$_SERVER['HTTP_HOST'].dirname($_SERVER['PHP_SELF'])."/".$relative_url $relative_url is a php file when i run this script with this header function in it, i get an error saying:"Redirection limit for this URL has exceeded. Unable to load the requested page." I dont understand why i get this error and how to fix this. Ben __ Do you Yahoo!? U2 on LAUNCH - Exclusive greatest hits videos http://launch.yahoo.com/u2 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] php header function...
Try removing all leading spaces between the shebang and the beginning of the script: #!/usr/bin/php -q Hey, > > > > Got a problem using the header function on a file upload page to redirect > the user back to a web page. Here's the code: > > > > #!/usr/bin/php -q > > > > > > > $filedest = "/home/$directory"; > > > > if (copy($clientfile,"$filedest/$clientfile_name")) > > > > header("Location: http://www.webfusion.net.au...";); > > > > else > > > > print("Error"); > > > > Any ideas on how i would get this to work. The error which shows is > Warning: Cannot add header information - headers already sent > > > > Thanks in advance. > > > > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] php header function...
Hey, Got a problem using the header function on a file upload page to redirect the user back to a web page. Here's the code: #!/usr/bin/php -q http://www.webfusion.net.au...";); else print("Error"); Any ideas on how i would get this to work. The error which shows is Warning: Cannot add header information - headers already sent Thanks in advance. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] header() -- function failed to due caching.
Hi Scott, If you are using IE, make sure that the browser checks for updates every visit to the page. (Tools->Internet Options->Settings). I am not sure that this setting observes Cache-Control, etc... Are you setting the Cache-Control header to Private and the expires header to a suitable time? Regards, Patrick Lynch http://www.optip.com/ -Original Message- From: Scott Fletcher [mailto:[EMAIL PROTECTED]] Sent: 15 May 2002 18:31 To: [EMAIL PROTECTED] Subject: [PHP] header() -- function failed to due caching. I tried to use this script but it failed due to the caching. Does anyone know the way around hte problem or have a solution to the problem? --- example script $url_address = $GLOBALS["HTTP_HOST"]; switch ($url_address) { case "www.php.net": $url_address = "http://www.php.net/db2admin/db2_cleanup.php";; break; case "test.php.net": $url_address = "https://test.php.net/db2admin/db2_cleanup.php";; break; default: $url_address = " "; echo $url_address; break; } header("Location: $url_address"); --- example script end -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] header() -- function failed to due caching.
I tried to use this script but it failed due to the caching. Does anyone know the way around hte problem or have a solution to the problem? --- example script $url_address = $GLOBALS["HTTP_HOST"]; switch ($url_address) { case "www.php.net": $url_address = "http://www.php.net/db2admin/db2_cleanup.php";; break; case "test.php.net": $url_address = "https://test.php.net/db2admin/db2_cleanup.php";; break; default: $url_address = " "; echo $url_address; break; } header("Location: $url_address"); --- example script end -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Header function not working header('Window-target: _top');
Hi to all, Sorry for bringing back this type of topic, But this type of header call really doesnt work for me here. I've tested many time's the example below that was given by Dan but it really doesnt work. Im already using php4.2 in apache 1.3.24 . Based on the example below i've just removed/uncomment the header function for "left.php" to test if it realy jump out of the frame. Is there any idea why header('Window-target: _top'); doesnt work for me. Please help. Regards, Mike - Original Message - From: "Analysis & Solutions" <[EMAIL PROTECTED]> To: "PHP List" <[EMAIL PROTECTED]> Sent: Friday, March 15, 2002 11:27 PM Subject: Re: [PHP] Targetted redirection? > Hi Folks: > > Okay, here's what I'm talking about... A sample system. Four files. > > index.php main page holding the frameset. frameset has two > frames. one on left. one on right. > left.php navigation menu that goes in the left hand frame > right.php content in right hand frame. this page is the default > one that comes up in the initial frameset. > right2.phpanother page for the right hand frame > > > * index.php ** > > # This has no effect. > # header('Window-target: _top'); > ?> > > > index page > > > > > > > > * left.php ** > > # Turning this on will jump this page out of the frames. header('Window-target: _top'); > ?> > > the menu > right > right 2 > > > > * right.php ** > > # Turning this on will jump this page out of the frames. > # header('Window-target: _top'); > ?> > > Right > Hi there. This is the main content page in the right frame. > > > > * right2.php ** > > # This has no effect. > # header('Window-target: _top'); > ?> > > Right 2 > Hi there. This is the secondary content page in the right frame. > > > > > Now, put all those files on your machine. Hit index.php and you'll see > everything normally. Then, uncomment the header function in left.php or > right.php and you'll see that page jump out of the frames. But, turn > the header on in index.php or index2.php and you'll still be in the > frames. > > Enjoy, > > --Dan > > -- > PHP scripts that make your job easier > http://www.analysisandsolutions.com/code/ > SQL Solution | Layout Solution | Form Solution > T H E A N A L Y S I S A N D S O L U T I O N S C O M P A N Y > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Header() function and redirect
On 30-Aug-2001 Zhu George-CZZ010 wrote: > But I have to wait for the application to finish. The idea is: the > application will take the file, and convert it into PDF file (it takes more > than 30 seconds generally), then display the generated PDF file. > > I am just wondering if I can use "Header()" to redirect to a general php > page, then in that page, redirect to the PDF file. > 30 seconds might be timing-out, instead let the browser handle the sleeping: http://tt.mot.com/to_pdf/pdf_tmp/test.pdf'; $sleepfor=30; printf('', $sleepfor, $goto); // run the job $cmd='foo -bar baz '; system($cmd); ?> -- Don Read [EMAIL PROTECTED] -- It's always darkest before the dawn. So if you are going to steal the neighbor's newspaper, that's the time to do it. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Header() function and redirect
From: Zhu George-CZZ010 <[EMAIL PROTECTED]> Date: Thu, Aug 30, 2001 at 11:27:41AM -0500 Message-ID: <[EMAIL PROTECTED]> Subject: RE: [PHP] Header() function and redirect > But I have to wait for the application to finish. The idea is: the application will >take the file, and convert it into PDF file (it takes more than 30 seconds >generally), then display the generated PDF file. > > I am just wondering if I can use "Header()" to redirect to a general php page, then >in that page, redirect to the PDF file. > > Thanks, > George Ah... well... Don't know what you exactly mean, but you either have to wait 'till the processing has been done (which, like I said, takes too long to wait for), or you can use one of the following options: - You can have an email send to the user telling him/her that the PDF is ready. You can either send it as an attachment, or just send a URL of the page where the PDF can be downloaded. - You can have the user redirected to a page with a download link on it. Then you still have to problem, though, that the PDF isn't ready yet at the moment the user gets that link. But you get back to what you're wondering ("if I can use "Header()" to redirect to a general php page"); Yes, ofcourse... you can do it before or after the processing. But! You can't do anything about client-timeouts. And let's be honest... It's not that weird that a browser gives up if it doesn't get any answer for more than 30 seconds. It's a pretty long timeout already. -- * R&zE: -- -- Renze Munnik -- DataLink BV -- -- E: [EMAIL PROTECTED] -- W: +31 23 5326162 -- F: +31 23 5322144 -- M: +31 6 21811143 -- -- Stationsplein 82 -- 2011 LM HAARLEM -- Netherlands -- -- http://www.datalink.nl -- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP] Header() function and redirect
But I have to wait for the application to finish. The idea is: the application will take the file, and convert it into PDF file (it takes more than 30 seconds generally), then display the generated PDF file. I am just wondering if I can use "Header()" to redirect to a general php page, then in that page, redirect to the PDF file. Thanks, George -Original Message- From: * R&zE: [mailto:[EMAIL PROTECTED]] Sent: Thursday, August 30, 2001 11:19 AM To: Zhu George-CZZ010; [EMAIL PROTECTED] Subject: Re: [PHP] Header() function and redirect From: Zhu George-CZZ010 <[EMAIL PROTECTED]> Date: Thu, Aug 30, 2001 at 11:10:19AM -0500 Message-ID: <[EMAIL PROTECTED]> Subject: [PHP] Header() function and redirect > > I am using Apache and PHP. I encountered a redirect problem in PHP, and traced it >down, so, I generated a very short PHP page as following: > > sleep(30); > $goto = "http://tt.mot.com/to_pdf/pdf_tmp/test.pdf";; > Header("Location: $goto"); > exit; > ?> > > If the "sleep(30);" statement is commented out, this page works fine in both >IE4.0/IE5.0 and netscape, but if "sleep(30)" statement is in this page, it will only >work in Netscape, but not in IE. > > Is there another way to do the "redirect" in PHP? or how to fix this problem (I >can't remove the "sleep" statement because in the real program, it is a "System call" >and will take more than 30 seconds)? > > Thank you very much in advance. > > Regards, > George > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > To contact the list administrators, e-mail: [EMAIL PROTECTED] You can (possibly) just redirect before the rest of your script. Ofcourse you can't do that when the rest of the script produces output, but it seems to me like it doesn't. Try the next code: --- PHP code --- http://somewhere.com";); error_log ("And still my script is running!", 0); ?> --- End of PHP code --- You'll see that the original script will write the line to the logfile although the user is already redirected to the next page. Btw... 30 seconds is a rather long time. No user will ever want to wait that long. Just my opinion... -- * R&zE: -- -- Renze Munnik -- DataLink BV -- -- E: [EMAIL PROTECTED] -- W: +31 23 5326162 -- F: +31 23 5322144 -- M: +31 6 21811143 -- -- Stationsplein 82 -- 2011 LM HAARLEM -- Netherlands -- -- http://www.datalink.nl -- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Header() function and redirect
From: Zhu George-CZZ010 <[EMAIL PROTECTED]> Date: Thu, Aug 30, 2001 at 11:10:19AM -0500 Message-ID: <[EMAIL PROTECTED]> Subject: [PHP] Header() function and redirect > > I am using Apache and PHP. I encountered a redirect problem in PHP, and traced it >down, so, I generated a very short PHP page as following: > > sleep(30); > $goto = "http://tt.mot.com/to_pdf/pdf_tmp/test.pdf";; > Header("Location: $goto"); > exit; > ?> > > If the "sleep(30);" statement is commented out, this page works fine in both >IE4.0/IE5.0 and netscape, but if "sleep(30)" statement is in this page, it will only >work in Netscape, but not in IE. > > Is there another way to do the "redirect" in PHP? or how to fix this problem (I >can't remove the "sleep" statement because in the real program, it is a "System call" >and will take more than 30 seconds)? > > Thank you very much in advance. > > Regards, > George > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > To contact the list administrators, e-mail: [EMAIL PROTECTED] You can (possibly) just redirect before the rest of your script. Ofcourse you can't do that when the rest of the script produces output, but it seems to me like it doesn't. Try the next code: --- PHP code --- http://somewhere.com";); error_log ("And still my script is running!", 0); ?> --- End of PHP code --- You'll see that the original script will write the line to the logfile although the user is already redirected to the next page. Btw... 30 seconds is a rather long time. No user will ever want to wait that long. Just my opinion... -- * R&zE: -- -- Renze Munnik -- DataLink BV -- -- E: [EMAIL PROTECTED] -- W: +31 23 5326162 -- F: +31 23 5322144 -- M: +31 6 21811143 -- -- Stationsplein 82 -- 2011 LM HAARLEM -- Netherlands -- -- http://www.datalink.nl -- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Header() function and redirect
I am using Apache and PHP. I encountered a redirect problem in PHP, and traced it down, so, I generated a very short PHP page as following: http://tt.mot.com/to_pdf/pdf_tmp/test.pdf";; Header("Location: $goto"); exit; ?> If the "sleep(30);" statement is commented out, this page works fine in both IE4.0/IE5.0 and netscape, but if "sleep(30)" statement is in this page, it will only work in Netscape, but not in IE. Is there another way to do the "redirect" in PHP? or how to fix this problem (I can't remove the "sleep" statement because in the real program, it is a "System call" and will take more than 30 seconds)? Thank you very much in advance. Regards, George -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] header function
On Tuesday 21 August 2001 16:53, Jay Paulson wrote: > I have a slight problem.. I'm running php 4.0.6 on RedHat 7.1 and I run > my script and it hit's: > > header("Location:index.php"); > > well the thing is once it hits that line in my script and just fails, > however i don't get any type of parse error the browser just says 404 > error page not found... could it be i forgot to add something when i > configured and installed php on my machine? (1) Add a space after the colon (2) "Location:" should get a complete URL, i.e. header ("Location: http://your.server.us/index.php";); > and have it hit the header() line and i get teh 404 page error.. (and A 404 can't come from parse errors or something. It *does* redirect you, but doesn't find the target file -> 404 -- Christian Reiniger LGDC Webmaster (http://lgdc.sunsite.dk/) Install once, run forever. Linux. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] header function
You're right when you say that you shouldn't put an echo before the header.. however I did that just so I could see if I would get the error "All headers have been sent" and well I didn't get that error... I didn't get any error message.. so I thought that was strange and that's why I'm here asking this question because I really don't know what's going on.. I have checked the web server error log and when I call the header function it tries to redirect me to a ".php" file (notice there is no file name). So I'm not sure what exactly is going on. [Mon Aug 20 17:23:03 2001] [error] [client 64.132.13.114] File does not exist: /home/username/htdocs/admin/.php - Original Message - From: "Tyler Longren" <[EMAIL PROTECTED]> To: "Jay Paulson" <[EMAIL PROTECTED]> Cc: <[EMAIL PROTECTED]> Sent: Tuesday, August 21, 2001 9:54 AM Subject: Re: [PHP] header function > Well, it's not a good idea to put something (like an echo) before a > header()...even for testing because that will prevent the header() from > working at all. You should have gotten an "All headers have been sent" or > some similar error. > > -- > Tyler Longren > Captain Jack Communications > [EMAIL PROTECTED] > www.captainjack.com > > > > On Tue, 21 Aug 2001 09:53:42 -0500 > "Jay Paulson" <[EMAIL PROTECTED]> wrote: > > > Hello everyone- > > > > I have a slight problem.. I'm running php 4.0.6 on RedHat 7.1 and I run > > my > > script and it hit's: > > > > header("Location:index.php"); > > > > well the thing is once it hits that line in my script and just fails, > > however i don't get any type of parse error the browser just says 404 > > error > > page not found... could it be i forgot to add something when i > > configured > > and installed php on my machine? > > > > i'm really losted here cause i can put an echo "blah"; before it or > > after it > > and it will print out just fine.. but comment out that echo and have it > > hit > > the header() line and i get teh 404 page error.. (and yes i've double > > and > > tripled checked that all the files etc are there it's just not doing the > > header function for some reason) > > > > Thanks! > > Jay > > > > > > -- > > PHP General Mailing List (http://www.php.net/) > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > For additional commands, e-mail: [EMAIL PROTECTED] > > To contact the list administrators, e-mail: [EMAIL PROTECTED] > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > To contact the list administrators, e-mail: [EMAIL PROTECTED] > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] header function
Well, it's not a good idea to put something (like an echo) before a header()...even for testing because that will prevent the header() from working at all. You should have gotten an "All headers have been sent" or some similar error. -- Tyler Longren Captain Jack Communications [EMAIL PROTECTED] www.captainjack.com On Tue, 21 Aug 2001 09:53:42 -0500 "Jay Paulson" <[EMAIL PROTECTED]> wrote: > Hello everyone- > > I have a slight problem.. I'm running php 4.0.6 on RedHat 7.1 and I run > my > script and it hit's: > > header("Location:index.php"); > > well the thing is once it hits that line in my script and just fails, > however i don't get any type of parse error the browser just says 404 > error > page not found... could it be i forgot to add something when i > configured > and installed php on my machine? > > i'm really losted here cause i can put an echo "blah"; before it or > after it > and it will print out just fine.. but comment out that echo and have it > hit > the header() line and i get teh 404 page error.. (and yes i've double > and > tripled checked that all the files etc are there it's just not doing the > header function for some reason) > > Thanks! > Jay > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] header function
Hello everyone- I have a slight problem.. I'm running php 4.0.6 on RedHat 7.1 and I run my script and it hit's: header("Location:index.php"); well the thing is once it hits that line in my script and just fails, however i don't get any type of parse error the browser just says 404 error page not found... could it be i forgot to add something when i configured and installed php on my machine? i'm really losted here cause i can put an echo "blah"; before it or after it and it will print out just fine.. but comment out that echo and have it hit the header() line and i get teh 404 page error.. (and yes i've double and tripled checked that all the files etc are there it's just not doing the header function for some reason) Thanks! Jay -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] header function
Hello everyone- I have a slight problem.. I'm running php 4.0.6 on RedHat 7.1 and I run my script and it hit's: header("Location:index.php"); well the thing is once it hits that line in my script and just fails, however i don't get any type of parse error the browser just says 404 error page not found... could it be i forgot to add something when i configured and installed php on my machine? i'm really losted here cause i can put an echo "blah"; before it or after it and it will print out just fine.. but comment out that echo and have it hit the header() line and i get teh 404 page error.. (and yes i've double and tripled checked that all the files etc are there it's just not doing the header function for some reason) Thanks! Jay -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]