Re: [PHP] Re: PHP Header issue
On Fri, 2009-09-18 at 19:01 +0200, Ralph Deffke wrote: sorry man, but no blancs etc. means NOTHING should be send before the header it should look like this: ?php header(Location: advertise2.php); ? here u can do ur html not one! single char incl. space should be outputted before the header e.g. before the php open tag. ralph_def...@yahoo.de Ernie Kemp ernie.k...@sympatico.ca wrote in message news:blu0-smtp35a2b5ec02eb211ecaa8b1f9...@phx.gbl... html head titleContact Us/title /head body ?php header(Location: advertise2.php); ? /body /html The above is just snippet of the code but even this simple example throws the Header Warning / Error. Warning: Cannot modify header information - headers already sent by (output started at /home/content/g/t/a /html/yourestate/advertise.php:6) in/home/content/g/t/a /html/yourestate/advertise.php on line 6 The anwser may be simple but I have looked a blanks or spaces around the ?php ? with no success. Ready need your help. Thanks, Ernie Kemp Phone: 416 577 5565 Email: ek...@digitalbiz4u.com ...man will occasionally stumble over the truth, but usually manages to pick himself up, walk over or around it, and carry on. Winston S. Churchill I think this sort of issue arises particularly because of the misconception that PHP is embedded inside HTML pages. Once a person has that idea in their head, they will start to work with an HTML template and add PHP as necessary. While that can work, in cases such as this, it's best to remember that HTML (and XML or other languages, etc) is inserted into PHP scripts. Thanks, Ash http://www.ashleysheridan.co.uk -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Re: PHP Header issue
From: Ashley Sheridan On Fri, 2009-09-18 at 19:01 +0200, Ralph Deffke wrote: sorry man, but no blancs etc. means NOTHING should be send before the header it should look like this: ?php header(Location: advertise2.php); ? here u can do ur html not one! single char incl. space should be outputted before the header e.g. before the php open tag. I think this sort of issue arises particularly because of the misconception that PHP is embedded inside HTML pages. Once a person has that idea in their head, they will start to work with an HTML template and add PHP as necessary. While that can work, in cases such as this, it's best to remember that HTML (and XML or other languages, etc) is inserted into PHP scripts. After using Perl to generate HTML, that is exactly what it looks like. I always believed that was the way PHP was designed, so the PHP scripts are embedded inside the HTML. It is a much more logical construct than trying to use Perl, or C or ... Bob McConnell -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Re: PHP Header issue
I think this sort of issue arises particularly because of the misconception that PHP is embedded inside HTML pages. Once a person has that idea in their head, they will start to work with an HTML template and add PHP as necessary. While that can work, in cases such as this, it's best to remember that HTML (and XML or other languages, etc) is inserted into PHP scripts. I think PHP embedded is not a good idea in any case, the output should be the last thing ever to manage/perform, and not vice-versa: PHP in the middle of an output stream. This simply means more speed, less implicit or explicit echo/parsing/flow interruptions, more control, and more flexibility, since last part ever of the required page could decide at the end to produce an html page, an XML, eventually transformed via XSL (or transformed via client later), a JSON response, a PDF, an csv ... etc etc ... php embedded is the reason php is so popular but the reason there are a lot of bad applications as well - not because of its embeddable nature, simply 'casue being simple often means being used by lots of wannabe programmers sometimes not even interested about learning it more than they already know. I always says PHP is easy to use, but extremely hard to use properly. The learning curve is often stuck miles before 100/100 ... and I do not absolutely consider myself a 100/100 PHP dev ... actually, I do not know anybody that cool, maybe because at some point people switch into another language a la Python, C#, or Java ... Just my opinion, Regards _ Drag n’ drop—Get easy photo sharing with Windows Live™ Photos. http://www.microsoft.com/windows/windowslive/products/photos.aspx