You are here: Re: SOLVED: How to upload form data containing special characters correctly? « PHP Programming Language « IT news, forums, messages
Re: SOLVED: How to upload form data containing special characters correctly?

Posted by malatestapunk on 09/07/06 16:01

Wim Cossement wrote:
> malatestapunk wrote:
> >
> > I'm glad to hear you solved your problem. But just in case you need it
> > anytime later, you received the error when you tried to send a header
> > through PHP because there was some output before the header. You should
> > always send headers first, before anything else goes out.
> >
> > regards,
> > Vladislav
>
> Hi Vladislav,

Hello Wim,


>
> It was the 1st line of the PHP code, before preparing and executing the
> SQL statement.
>
> Before that there was just some common HTML, containing the <head> and
> beginning of the <body>.


So there you go :)

Seriously, plain HTML is considered as output as well. Headers should
be sent before anything else leaves the server.


>
> From my limited knowledge of HTTP I thought that the headers were
> always the first data being sent by the webserver, and that this is done
> automatically.
>


That's true. However, you can set headers from your server side script
as well. This can come in handy: for instance, when you can't (or
won't, or aren't allowed to) alter your server configuration.


> And I just found out that adding <? header("Content-type: text/html;
> charset=utf-8"); ?> would do the same as specifying the header in the
> Apache config or .htaccess file, if the HTTP headers from the website
> would be turned of, right?


Exactly. Since you solved your problem through server configuration,
you don't have to use it at all - I'm not insisting ;). I was only
pointing at what was the problem you encountered with headers
generally.

The same rule applies to cookies and sessions - you must initialize and
set them before you output anything.


>
> Regards,
>
> Wimmy

best wishes,
Vladislav

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация