SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Zealot suro's Avatar
    Join Date
    Jan 2005
    Posts
    155
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Knowing current line number...

    Hi
    Can you tell me how can I know the exact line number where some kind of function is executed?

    And also $_SERVER['HTTP_REFERER'] shows the url from where the file is executed but not the file.
    For example if the file name is test.php which resides on http://localhost/scripts/
    HTTP_REFERER shows only the http://localhost/scripts/ but not http://localhost/scripts/test.php

    Thanks
    Last edited by suro; Nov 29, 2005 at 14:40.

  2. #2
    SitePoint Guru aamonkey's Avatar
    Join Date
    Sep 2004
    Location
    kansas
    Posts
    953
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    for the line # use __LINE__

    and HTTP_REFERER doesn't show the executing script, it show the previous page...
    for the current executing script use $_SERVER['SCRIPT_FILENAME'] or
    PHP Code:
      $url 'http://' $_SERVER['SCRIPT_FILENAME'] . $_SERVER['SCRIPT_FILENAME']; 

  3. #3
    SitePoint Zealot suro's Avatar
    Join Date
    Jan 2005
    Posts
    155
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Cool, exactly what I wanted, Thanks.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •