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 comments so far

  1. […] Gara-gara Spasi, muncul Warning July 26, 2008 11:03 am admin Dari Blogger – Agreegator Dari https://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

Isikan data di bawah atau klik salah satu ikon untuk log in:

Logo WordPress.com

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

Gambar Twitter

You are commenting using your Twitter account. Logout / Ubah )

Foto Facebook

You are commenting using your Facebook account. Logout / Ubah )

Foto Google+

You are commenting using your Google+ account. Logout / Ubah )

Connecting to %s

%d blogger menyukai ini: