Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 11 of 11
  1. #1
    Regular Coder
    Join Date
    May 2006
    Posts
    216
    Thanks
    4
    Thanked 0 Times in 0 Posts

    Why is corrupted design?

    I have seen and tested many times. I have variable code like:
    $PATH1 = "http://" . $_SERVER['HTTP_HOST']."/";
    $PATH2 = $_SERVER['DOCUMENT_ROOT']."/";

    and included file with code like:
    PHP Code:
    PHP Code:
    <?PHP @require_once($PATH1."en-US/footer/footer.php");?>
    Issue is if I use PATH1 it will work nice design, but if I use $PATH2 it will be corrupted design within IE. I noticed in the past that image should be in the same line as TD (table) and influences design within IE. But I do not get it why influences DOCUMENT_ROOT variable with corrupted design as PATH is correct.

  • #2
    Supreme Master coder! _Aerospace_Eng_'s Avatar
    Join Date
    Dec 2004
    Location
    In a place far, far away...
    Posts
    19,291
    Thanks
    2
    Thanked 1,043 Times in 1,019 Posts
    Don't use path one. You should be using path2. Path1 will only work if url fopen wrappers is enabled. On most servers it isn't. Is footer.php even loading? If you view the code in your browser to you see the html for footer.php?

    Do you have error_reporting turned on? e.g.
    PHP Code:
    ini_set('display_errors','1');
    error_reporting(E_ALL); 
    Put that at the top of your code.
    ||||If you are getting paid to do a job, don't ask for help on it!||||

  • #3
    Regular Coder
    Join Date
    May 2006
    Posts
    216
    Thanks
    4
    Thanked 0 Times in 0 Posts
    I have
    1. url fopen enabled
    2. I have put also your error message and it works footer and error is empty value
    3. Now works footer even I use PATH2.
    Is there any issue with IE that it does nto detect all correct?
    Do you have some experience with this?
    4. How to make each correct error message with number and it stores within db?
    It should not show values of FTP path...

  • #4
    Supreme Master coder! _Aerospace_Eng_'s Avatar
    Join Date
    Dec 2004
    Location
    In a place far, far away...
    Posts
    19,291
    Thanks
    2
    Thanked 1,043 Times in 1,019 Posts
    Also remove @ from the require_once. I'm not sure what you mean by number 4. Are you saying you want errors logged into a database? Usually there is a log file that is created. Your host also usually keeps track of errors in the control panel.
    ||||If you are getting paid to do a job, don't ask for help on it!||||

  • #5
    Senior Coder NancyJ's Avatar
    Join Date
    Feb 2005
    Location
    Bradford, UK
    Posts
    3,172
    Thanks
    19
    Thanked 65 Times in 64 Posts
    The best way to debug this would be to compare the html output between the 2 versions. Once you find the difference, you'll know where to look to find the problem

    I suspect you have some php code in there that is causing the different rendering.

  • #6
    Regular Coder
    Join Date
    May 2006
    Posts
    216
    Thanks
    4
    Thanked 0 Times in 0 Posts
    4. How to make each correct error message with number and it stores within db
    5. Can be at the top
    require_once("variables.php"); or it should be always
    include ("variables.php");

  • #7
    Supreme Master coder! _Aerospace_Eng_'s Avatar
    Join Date
    Dec 2004
    Location
    In a place far, far away...
    Posts
    19,291
    Thanks
    2
    Thanked 1,043 Times in 1,019 Posts
    require will cause a fatal error if it can't find the file while include will throw an error but will continue processing. Please post your complete code for footer.php.

    Again still not sure what you are saying with number four. Please try to type proper English.
    ||||If you are getting paid to do a job, don't ask for help on it!||||

  • #8
    Regular Coder
    Join Date
    May 2006
    Posts
    216
    Thanks
    4
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by _Aerospace_Eng_ View Post
    require will cause a fatal error if it can't find the file while include will throw an error but will continue processing. Please post your complete code for footer.php.

    Again still not sure what you are saying with number four. Please try to type proper English.
    So, is the best correct way require OR include for VARIABLE FILE?
    How to make error message with number and it stores within db?

    Do you understand now?

  • #9
    Supreme Master coder! _Aerospace_Eng_'s Avatar
    Join Date
    Dec 2004
    Location
    In a place far, far away...
    Posts
    19,291
    Thanks
    2
    Thanked 1,043 Times in 1,019 Posts
    Use require if you need those files for something to run properly. Again still don't understand you last question? What errors? From where?
    ||||If you are getting paid to do a job, don't ask for help on it!||||

  • #10
    Regular Coder
    Join Date
    May 2006
    Posts
    216
    Thanks
    4
    Thanked 0 Times in 0 Posts
    You see there can be different errors on page (standard errors like Page not found...)
    It can be db connection FAILURE message....connection to file not possible...
    I would like to create system to track these errors and avoid display of any error.

    Example:
    error is detected in error message and it shows page:
    Error number X. Please contact administrator that this erros occured.

    So, it will not show him any data PATH, VALUES from this error.

  • #11
    Supreme Master coder! _Aerospace_Eng_'s Avatar
    Join Date
    Dec 2004
    Location
    In a place far, far away...
    Posts
    19,291
    Thanks
    2
    Thanked 1,043 Times in 1,019 Posts
    Okay now I see. This is probably the best you will be able to do.

    http://us2.php.net/set_error_handler
    ||||If you are getting paid to do a job, don't ask for help on it!||||


  •  

    Posting Permissions

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