Gara-gara Spasi, muncul Warning

Sebagaimana dimaklumi, untuk mengirim header HTTP, perintah header() di PHP harus diletakkan di paling atas atau sebelum PHP mencetak / memberikan keluaran apapun. Jika tidak maka akan muncul peringatan spt. di bawah ini di halaman perambah:

Warning: Cannot modify header information – headers already sent by (output started at /home/sihab/Documents/myWeb/etc/pgdbconn.inc.php:11) in /home/sihab/Documents/myWeb/etc/alfonso.php on line 217

Seperti kasus yg saya alami. Perintah header() sudah saya letakkan di bagian (yg menurut saya) belum ada memberikan keluaran apapun. Namun ternyata muncul peringatan (warning) di atas.

Pesan peringatan di atas sebetulnya sudah menunjukkan dari mana masalah muncul, yakni pd 'pgdbconn.inc.php' baris 11. Ya, sebelum header() ada perintah require_once('pgdbconn.inc.php') namun saya tidak menemukan bahwa telah mencetak sesuatu di sana.

Ternyata, pada akhir tag ?> masih ada karakter spasi….. Duh!

3 komentar

  1. [...] Gara-gara Spasi, muncul Warning July 26, 2008 11:03 am admin Dari Blogger – Agreegator Dari http://eshabe.wordpress.com/2008/07/26/gara-gara-spasi-muncul-warning/ [...]

  2. Cristina Farfan on

    An impressive share, I simply given this onto a colleague who was doing a little analysis on this. And he in reality purchased me breakfast as a result of I found it for him.. smile. So let me reword that: Thnx for the treat But yeah Thnkx for spending the time to discuss this, I really feel strongly about it and love studying extra on this topic. If doable, as you develop into experience, would you mind updating your weblog with more details? It’s highly helpful for me. Big thumb up for this blog submit some tips here Phentermine 37.5, Phen375 Review, Phen375

  3. hp mini 210 review on

    Wow!, this was a real quality post. In theory Id like to write like this too – taking time and real effort to make a good article but what can I say I keep putting it off and never seem to achieve anything


Tinggalkan Balasan

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Ubah )

Twitter picture

You are commenting using your Twitter account. Log Out / Ubah )

Facebook photo

You are commenting using your Facebook account. Log Out / Ubah )

Connecting to %s

Ikuti

Get every new post delivered to your Inbox.

Bergabunglah dengan 45 pengikut lainnya.