Jump to content

I have a straightforward question about errors in general


cluce

Recommended Posts

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.

 

Link to comment
Share on other sites

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?

Link to comment
Share on other sites

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);

?> 

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.