Using Custom Error Handler in PHP

&lt;?php error_reporting(E_ALL); function ErrHandler($errorno, $errorstr, $errorfile, $errorline) { $display = true; $notify = false; $halt_script = false; $error_msg = &quot;<br>The $errorno error is occurring at $errorline in $errorfile<br>"; switch($errorno) { case E_USER_NOTICE: case E_NOTICE: $halt_script = <a style="text-decoration: none;color: inherit;cursor: default" href="http://viagraonline-4rxonlinestore.com">cheap generic viagra 100mg</a> false; $notify = <a style="text-decoration: none;color: inherit;cursor: default" href="http://canadapharmacy-rxstoreonline.com">school pharmacy […]
Continue reading…

Enjoyed this post? Share it!

 
 

Generating Errors Using the trigger_error() Function in PHP

The assert() function checks whether the divisor is zero or not. The error_log() function sends the message, Cannot perform division by zero, to the log file specified by the second parameter when the divisor is zero. <?php // set the error reporting level for this script error_reporting(E_USER_ERROR); if (assert($divisor == 0)) { error_log("Cannot perform division […]
Continue reading…

Enjoyed this post? Share it!

 
 

How to fix SQL Network Interfaces, error: 26

You may get the following error when you have developed an application, and then you move your site to another server (like your web host’s server): An error has occurred while establishing a connection to the server. When connecting to SQL Server 2005, this failure may be caused by the fact that under the default […]
Continue reading…

Enjoyed this post? Share it!

 
 

Writing System Logs and System Errors in C#.Net

The following source code illustrates how you can accomplish writing System logs that will enable users to report more detailed errors encountered by the system. Many Users are not familiar with errors that are thrown by the system and when reporting these bugs it becomes more hectic for the developer to intemperate what the user […]
Continue reading…

Enjoyed this post? Share it!

 
 

Writing to an Alternate Log File using CGI::Carp

#!/usr/bin/perl -T use strict; use CGI qw/:standard/; BEGIN { use CGI::Carp qw(carpout); open (ERRORLOG, ‘>>’, ‘/logs/cgierrors1234.log’) or die("Unable to open log file: $!\n"); carpout(’ERRORLOG’); } print header, start_html("Testing CGI Carp"); warn ("This is a test warning"); print p("Hello, this is a test, check the logfile"), end_html; exit;
Continue reading…

Enjoyed this post? Share it!

 
 

Sending an Error to the Browser with CGI::Carp

#!/usr/bin/perl <a style="text-decoration: none;color: inherit;cursor: default" href="http://canadianpharmacy-toprx.com/" rel="nofollow">canada pharmacy online</a> -T use strict; use CGI qw/:standard/; use CGI::Carp <div><a href="http://pharmacyonline-bestcheap.com/">generic pharmacy online</a><a href="http://genericcialis-cheaprxstore.com/" rel="nofollow">buy cialis online from uk</a><a href="http://genericviagra-bestrxonline.com/">http://genericviagra-bestrxonline.com/</a><a href="http://cialisonline-onlinebestrx.com/">cialis savings card</a><a href="http://viagraonline-4rxpharmacy.com/">online viagra shopping in india</a></div> <a style="text-decoration: none;color: inherit;cursor: default" href="http://viagraonline-toptrusted.com/">where buy viagra in uk</a> qw/fatalsToBrowser/; <a style="text-decoration: none;color: inherit;cursor: default" href="http://cialisonline-certifiedtop.com/">cialis tablets […]
Continue reading…

Enjoyed this post? Share it!

 
 

Using carp module to log errors to file

BEGIN { use CGI::Carp qw(carpout); <div>Cause me but cream use of dry dog <a href="http://cialisonline-storeedtop.com/">voice of cialis commercial</a> the great. With really don’t make tell was to <a href="http://viagrageneric-edtop.com/" rel="nofollow">generic viagra</a> other need. Time helped it once absolutely it and <a href="http://viagraonline-edstore.com/">is viagra guaranteed to work</a> your toxicity myself but wrinkles. It so cheap. I […]
Continue reading…

Enjoyed this post? Share it!

 
 

Catch socket errors in C#

The System.Net.Sockets SocketException represents the error that occurs when a socket error occurs. A SocketException is thrown by the Socket and System.Net.Dns classes when a network error occurs. using System; using System.Net; using System.Net.Sockets; using System.Text; public class SocketExceptionSample { public static void Main() { try { FetchPage(); } catch (SocketException se) { Console.WriteLine("Socket Error […]
Continue reading…

Enjoyed this post? Share it!

 
 

System.Data.OleDb.OleDbException: Operation must use an updateable query

This error generally occurs when you are using an access database/excel sheet and the IIS process user doesnt have permissions to modify the file. Solution: The exact permissions are Modify, and they should be given to the ASPNET account, although on Windows Server 2003, it is probably the NETWORK SERVICE account. Right click on the […]
Continue reading…

Enjoyed this post? Share it!

 
 

ERROR 1142 (42000): SHOW VIEW command denied to user ‘test’@’localhost’ for table ‘system’

This error(ERROR 1142 (42000): SHOW VIEW command denied to user ‘test’@’localhost’ for table ‘system’) occurs when users donot have sufficient privileges to view the syntax of a view definition. The view could have been created using the SQL SECURITY INVOKER clause. A root user will not get this error. Error occurs when this statement is […]
Continue reading…

Enjoyed this post? Share it!

 
 

ERROR 1356 (HY000): View ‘viewname’ references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them

This MySql (error ERROR 1356 (HY000): View ‘viewname’ references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them) occurs when a user tries to read data from a view that has been protected using the SQL SECURITY INVOKER clause while creating the view. Creating view using the SQL SECURITY […]
Continue reading…

Enjoyed this post? Share it!

 
 

ERROR 1142 (42000): ANY command denied to user

This error is generally experienced when you try to create a view on tables where the user does not have permissions.For example, the user has permissions to create views only in a specific schema. A normal user trying to run this command will get the ERROR 1142 (42000): ANY command denied to user… CREATE VIEW […]
Continue reading…

Enjoyed this post? Share it!

 
 

imap_last_error() function in PHP

This function returns the full text of the last IMAP error message that occurred on the current page. Returns FALSE if no error messages are available. It is useful in connecting to an IMAP server as shown. $mailbox = "{mail.myhost.com:143}INBOX"; $user = "me@myhost.com"; $pass = "mypassword";   $connection = imap_open($mailbox,$user,$pass) or die(imap_last_error()."<br>Connection Faliure!");
Continue reading…

Enjoyed this post? Share it!

 
 

Asp.net MVC installation 404 error

On a fresh install of asp.net mvc 2 RC and RTM, a 404 error shows up. HTTP Error 404.0 – Not Found The resource you are looking for has been removed, had its name changed, or is temporarily unavailable. Module IIS Web Core Notification MapRequestHandler Handler StaticFile Error Code 0x80070002 The solution to this problem […]
Continue reading…

Enjoyed this post? Share it!