Solved

determining php routine name or file name

Posted on 2008-09-29
4
199 Views
Last Modified: 2012-05-05
Hi -

Question, I am inserting some error handling.  If a query creates an error, I would like to log the name of the routine or perhaps the corresponding php filename.

Is this possible?  if so, what is the command to get the routine name or the php filename?

Thanks.

Pete
0
Comment
Question by:shafer23
  • 2
  • 2
4 Comments
 
LVL 27

Expert Comment

by:yodercm
ID: 22602111
0
 

Author Comment

by:shafer23
ID: 22602182
Hi thanks - that returned the name of the index file, but what I was trying to get is the name of a php file that is referenced by that index file (i.e. a file that does not appear within the url).  Maybe that is not possible???

Pete
0
 
LVL 27

Accepted Solution

by:
yodercm earned 500 total points
ID: 22602310
I'm not sure what you mean by the "index file", but look through the environmental values that you can get here:
http://hoohoo.ncsa.uiuc.edu/cgi/env.html
and see if any of them are what you want.

If not, it's possible to just put a variable such as $scriptname='whatever.php' into each script, so the error routine can use it.
0
 

Author Closing Comment

by:shafer23
ID: 31501430
thanks - that is probably what I will do.
0

Featured Post

Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Deprecated and Headed for the Dustbin By now, you have probably heard that some PHP features, while convenient, can also cause PHP security problems.  This article discusses one of those, called register_globals.  It is a thing you do not want.  …
Developers of all skill levels should learn to use current best practices when developing websites. However many developers, new and old, fall into the trap of using deprecated features because this is what so many tutorials and books tell them to u…
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
The viewer will learn how to count occurrences of each item in an array.

803 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question