Forum Moderators: martinibuster
This page appears blank when there error in php code.
If you are using it like <?php
echo"
<script type="text/javascript"><!--
google_ad_client = "#*$!";
google_ad_width = 728;
google_ad_height = 90;
google_ad_format = "728x90_as";
google_ad_type = "text_image";
google_ad_channel ="";
google_color_border = "E7C794";
google_color_bg = "E7C794";
google_color_link = "000000";
google_color_url = "FFFFFF";
google_color_text = "993300";
//--></script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
";
put in "\" back slash everywhere in php code.
dont put back slashes for echo tags.
wrong way
<?php
echo "
<script type="text/javascript"><!--
";
?>
correct way
<?php
echo "
<script type=\"text/javascript\"><!--
";
?>
just notice the back slashes.
some php code here;
?>
PUT ADSENSE CODE HERE
<?php
Resume php code here;end;
?>
The nice thing about PHP is that you can include HTML and code on the same page, just close the <?php tag, enter your HTML, and then open it back up. You can do this inside of a loop, while, foreach, if, etc., blocks. For example:
<?php
foreach ($items as $item) {
?>I have an item, and it's name is <?php echo $item;?>
<?php
}
?>
$string = 'this displays a double quote here " and again here ". now, I am closing the string';
insted of :
$string = "this displays a double quote here \" and again here \". now, I am closing the string";
Both of them work, but the first one was opened-closed using single quote, so, no need to put \ before the double quotes.