I was wondering, if there's a way to extend Exception in such a way, that it would contain name of a method where it has been thrown.
Right now I have this:
class myException extends Exception {
protected $method;
public function __construct($message, $method, $code = 0, Exception $previous = null) {
$this->method = $method;
parent::__construct($message, $code, $previous);
}
public function getMethod() {
return $this->method;
}
}
but passing __METHOD__ as a parameter whenever exception is thrown doesn't look really good...
[edit]
Oh wait a second... I can get it from trace, can't I?
mysql_real_escape_string
Let me preface this that I am very much a PHP noob, but I have some SQL training (not necessarily MySQL, we used the Microsoft variety in school). I have a weird problem, I'm trying to create a
There was a problem with the request. (Code: 0)
Any Idea what could cause this? I get it randomly at best. But with both IE and FF. It derives from an AJAX banner rotation script I am attempting to implement. Well have implemented it... And the
cURL error
So here is my code... I got it off of here... http://www.youtube.com/watch?v=XcgQUsorF_8Because I'm completely new to cURL, just wanna get a page that requires a login... I wrote everything word for
upload image name with extension using php
hi frds..<input id="file1" type="file" name="file[]" >upload image show path like C:\Documents and Settings\My Documents\My Pictures\images0056.jpgi need
New Search Engine
Hey everyone,I have a ZIP Code Radius search engine already functional. it displays all of the ZIP codes within a specified mileage around a central ZIP code.I have an auction site that the client
utl_file open error
i have file in the unix path
Preg_match with an array
is there an away to use preg_match with an array?i want to check a string with an array to see if it contains badwords however i get an error saying string expect it got an array, which i know.
Need help: how to catch acess of undefined class properties
Hello. I am learning OO with PHP and have hit a problem.Some code runs as perfectly valid code, where i would like PHP to issue a warning / error.I guess this is because of the loose typing of PHP,
IDOC error
Hi,
Using two $_POST Function / Switch () statements, second does not work.
Hi all. I’m new to php and am having a problem getting $_POST Function / switch () to work. I am coding a registration form. I ask the user a Yes/No question. Depending on the answer I have an