...

View Full Version : Why is corrupted design?



toplisek
05-12-2009, 09:41 AM
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 @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.

_Aerospace_Eng_
05-12-2009, 09:46 AM
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.

ini_set('display_errors','1');
error_reporting(E_ALL);
Put that at the top of your code.

toplisek
05-12-2009, 09:53 AM
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...

_Aerospace_Eng_
05-12-2009, 09:58 AM
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.

NancyJ
05-12-2009, 09:58 AM
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.

toplisek
05-12-2009, 10:03 AM
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");

_Aerospace_Eng_
05-12-2009, 10:34 AM
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.

toplisek
05-12-2009, 10:41 AM
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?

_Aerospace_Eng_
05-12-2009, 11:58 AM
Use require if you need those files for something to run properly. Again still don't understand you last question? What errors? From where?

toplisek
05-12-2009, 12:11 PM
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.

_Aerospace_Eng_
05-12-2009, 04:03 PM
Okay now I see. This is probably the best you will be able to do.

http://us2.php.net/set_error_handler



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum