SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Enthusiast
    Join Date
    Oct 2005
    Posts
    32
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Question Need some advice from PHP experts please...

    Hi all PHP experts,

    We are trying to change some PHP codes from a site we recently acquired, but we are no PHP experts and have come across a problem, which should be simple to solve for experienced PHP coders.

    Like most sites, our index.php "pulls" the header.php and footer.php....

    > We are trying to add in our adsense codes in the header.php but when we do, and upload the changes, the index.php cannot load the header (we can see the background image but nothing else loads in the page). Nb. all we did was paste in the adsense codes into the header.php

    > So, we thought that maybe we have added the wrong codes, so we tried downloading the header.php file and then re-uploading it WITHOUT any changes... but the same problem happened again.

    Questions:

    1) Is this happening because of some root access privalege problem or,

    2) Some binary format problem

    3) Or, is there a simple reason why this is happening...


    Thanks for all feedback.

    Nb. Our hosting is on PLESK.

  2. #2
    SitePoint Wizard silver trophy
    Join Date
    Mar 2006
    Posts
    6,132
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    when you view the html source, is all of the expected html being output?

    are you getting any php errors? if the include is failing, php would normally throw an error at you. its possible your host has display errors set to off.


    you can turn them on to debug.
    at the top of index.php put
    PHP Code:
    ini_set('display_errors'1);
    error_reporting(E_ALL); 

  3. #3
    SitePoint Enthusiast
    Join Date
    Oct 2005
    Posts
    32
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by clamcrusher
    when you view the html source, is all of the expected html being output?

    are you getting any php errors? if the include is failing, php would normally throw an error at you. its possible your host has display errors set to off.


    you can turn them on to debug.
    at the top of index.php put
    PHP Code:
    ini_set('display_errors'1);
    error_reporting(E_ALL); 
    Brilliant, we just tried this and this is the problem ie we did not turn on the 'error reporting'.

    Calmcrusher... you're a star... thank you so much.

  4. #4
    winter is around the corner Tomer's Avatar
    Join Date
    Jul 2005
    Location
    Israel
    Posts
    684
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    That's not the best way to solve this, just use this when adding your Google Adsense code.

    PHP Code:
    ?>

    ...adsense code here...

    <?
    - Tomer


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •