cluce Posted August 10, 2007 Share Posted August 10, 2007 if I have a code with this in it ........ $auth = @mysqli_query($mysqli,$val) or die(header("Location: error.html")); and the error feature is turned off on the server would I still get a blank page if i have a syntax error in the code or will it redirect me to the error.html page. Quote Link to comment https://forums.phpfreaks.com/topic/64247-i-have-a-straightforward-question-about-errors-in-general/ Share on other sites More sharing options...
MadTechie Posted August 10, 2007 Share Posted August 10, 2007 have you even tried it? also change $auth = @mysqli_query($mysqli,$val) or die(header("Location: error.html")); to $auth = @mysqli_query($mysqli,$val) or header("Location: error.html"); Quote Link to comment https://forums.phpfreaks.com/topic/64247-i-have-a-straightforward-question-about-errors-in-general/#findComment-320272 Share on other sites More sharing options...
cluce Posted August 10, 2007 Author Share Posted August 10, 2007 no, because we have someone else hosting the site and I never done that before(turn error checking off). I am not asking if the code is correct that was posted previously. My problem is I keep getting theses blank pages when I host the php pages through someone elses web server but when I host it locally they run fine??? He says he has php 5 installed same as me. and he insist its my syntax which I doubt it. But I think it may be my connection string? not sure I am troubleshooting that right now. Unless someone else here thinks it can be something else? Quote Link to comment https://forums.phpfreaks.com/topic/64247-i-have-a-straightforward-question-about-errors-in-general/#findComment-320284 Share on other sites More sharing options...
MadTechie Posted August 10, 2007 Share Posted August 10, 2007 this may help <?php // Turn off all error reporting error_reporting(0); // Report simple running errors error_reporting(E_ERROR | E_WARNING | E_PARSE); // Reporting E_NOTICE can be good too (to report uninitialized // variables or catch variable name misspellings ...) error_reporting(E_ERROR | E_WARNING | E_PARSE | E_NOTICE); // Report all errors except E_NOTICE // This is the default value set in php.ini error_reporting(E_ALL ^ E_NOTICE); // Report all PHP errors (bitwise 63 may be used in PHP 3) error_reporting(E_ALL); // Same as error_reporting(E_ALL); ini_set('error_reporting', E_ALL); ?> Quote Link to comment https://forums.phpfreaks.com/topic/64247-i-have-a-straightforward-question-about-errors-in-general/#findComment-320297 Share on other sites More sharing options...
wildteen88 Posted August 10, 2007 Share Posted August 10, 2007 Regards of whether the error reporting is disabled PHP will call the or die statement if the function returns false. Quote Link to comment https://forums.phpfreaks.com/topic/64247-i-have-a-straightforward-question-about-errors-in-general/#findComment-320304 Share on other sites More sharing options...
cluce Posted August 10, 2007 Author Share Posted August 10, 2007 Regards of whether the error reporting is disabled PHP will call the or die statement if the function returns false. thast what I thought, thanks Quote Link to comment https://forums.phpfreaks.com/topic/64247-i-have-a-straightforward-question-about-errors-in-general/#findComment-320307 Share on other sites More sharing options...
cluce Posted August 10, 2007 Author Share Posted August 10, 2007 this may help <?php // Turn off all error reporting error_reporting(0); // Report simple running errors error_reporting(E_ERROR | E_WARNING | E_PARSE); // Reporting E_NOTICE can be good too (to report uninitialized // variables or catch variable name misspellings ...) error_reporting(E_ERROR | E_WARNING | E_PARSE | E_NOTICE); // Report all errors except E_NOTICE // This is the default value set in php.ini error_reporting(E_ALL ^ E_NOTICE); // Report all PHP errors (bitwise 63 may be used in PHP 3) error_reporting(E_ALL); // Same as error_reporting(E_ALL); ini_set('error_reporting', E_ALL); ?> not usre, what to do with that code Quote Link to comment https://forums.phpfreaks.com/topic/64247-i-have-a-straightforward-question-about-errors-in-general/#findComment-320310 Share on other sites More sharing options...
MadTechie Posted August 10, 2007 Share Posted August 10, 2007 OK, if you add // Report all PHP errors (bitwise 63 may be used in PHP 3) error_reporting(0); ini_set('error_reporting', 0); to the start of your code, your it should be the same as turning error_reporting off via the php.ini, just may help with some testing Quote Link to comment https://forums.phpfreaks.com/topic/64247-i-have-a-straightforward-question-about-errors-in-general/#findComment-320329 Share on other sites More sharing options...
cluce Posted August 10, 2007 Author Share Posted August 10, 2007 OK, if you add // Report all PHP errors (bitwise 63 may be used in PHP 3) error_reporting(0); ini_set('error_reporting', 0); to the start of your code, your it should be the same as turning error_reporting off via the php.ini, just may help with some testing OK thanks Quote Link to comment https://forums.phpfreaks.com/topic/64247-i-have-a-straightforward-question-about-errors-in-general/#findComment-320335 Share on other sites More sharing options...
cluce Posted August 10, 2007 Author Share Posted August 10, 2007 would this type of connection string work on a linux hosting //$mysqli = @mysqli_connect("server", "username", "password", "database") or die(header("Location: error.html")); if not that may the problem becasue I am using windows to host Apache and the company is using Linux hosting Quote Link to comment https://forums.phpfreaks.com/topic/64247-i-have-a-straightforward-question-about-errors-in-general/#findComment-320340 Share on other sites More sharing options...
wildteen88 Posted August 10, 2007 Share Posted August 10, 2007 That will work fine, just make sure your host is using PHP5 and has the mysqli extension enabled (note, the i. The standard mysql library does not support mysqli_* functions). mysqli is for PHP5+ only. You can check this using phpino(); Also I hope you haven't got // at the begging of that line when you upload it to you host. As PHP will ignore that line as it'll see it as comment. Quote Link to comment https://forums.phpfreaks.com/topic/64247-i-have-a-straightforward-question-about-errors-in-general/#findComment-320346 Share on other sites More sharing options...
cluce Posted August 10, 2007 Author Share Posted August 10, 2007 Yes, thanks for all the replies. I have the company hosting our websites looking into it. As soon as I found out what the solution is I will post it. Quote Link to comment https://forums.phpfreaks.com/topic/64247-i-have-a-straightforward-question-about-errors-in-general/#findComment-320508 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.