Neden tarayıcısı kaynak kodunda bu metin ekranda gösterilmez?

3 Cevap php

Ben web üzerinde bulunan PHP varolan kaynak kodu izleyici senaryoyu değiştirerek duyuyorum. Bu güzel bir kategori şekilde kaynak kodu saklamaktır.

I am having a problem now though. Below is a screen shot of me viewing the source code in Firefox, you can see the part that is supposed to show on the screen but for some reason it is not showing on the screen, it is showing up in the source of the page though so I am really confused as to why I cannot view it in the browser? You will also notice that the text color is Pink/Purple color. The part inside the

Lütfen değil o gizli ya da bir şey yapıyor herhangi bir CSS olmadığını.

alt text

3 Cevap

<?php, sadece ?> ile kapatılmış olan bir açıklığı etiketi olarak kabul edilir; ve tarayıcı Etiketleri kendilerini göstermek değildir.

<td> etiketleri, örneğin, tarayıcınız tarafından görüntülenen değil: Onlar bir tablo oluşturmak için yorumlanır; o <?php etiketi ile aynı ... Ama tarayıcı ile ne yapacağını bilmiyor gibi, herhangi bir çıktı oluşturmaz.


If you want to actually display your portion of PHP code in the HTML page, you have to encode it to HTML entities :

  • < &lt; dönüştürülmesi gerekir
  • > &gt; dönüştürülmesi gerekir
  • & &amp; dönüştürülmesi gerekir
  • " &quot; dönüştürülmesi gerekir

Bu şekilde, bazı geçerli HTML almak değil, "şeyler HTML etiketleri gibi bakarak" olacak.


But note that if you want that portion of PHP code to actually be interpreted (So the query to the database is executed, and generates some output), you'll have to re-configure your webserver, so PHP code is interpreted : you should not see the PHP code on the browser-side.

Processing Instructions tarayıcıda gösterilmemiştir.

Yani "tarayıcısı kaynak kodu" değildir. PHP kaynak kodu superficially looks like HTML. Bu küçük bir ayrım değildir, ama aslında temel işlerin nasıl anlamak istiyorsanız. Firefox bu tam kodunu inceleyen varsa, bu metin olarak PHP, işlenmiş değil HTML inceleyen demektir.

Yani bir şey PHP sunucu kurulumu yanlış.