Include A File With Error Reporting

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Include A File With Error Reporting

    <?php

    $includefile="YOURFILE.php";
    //using fopen to verify file. the third parameter triggers include_path search
    $handle = fopen($includefile, "r", 1);
    if ($handle) {
    fclose($handle);
    include ($includefile);
    } else {
    echo "file: $includefile not found in path";
    echo "handle is: $handle";
    }

    ?>
    http://ngeo.ro

    #2
    dnt really understand wht this do......?
    sigpiceeeeerrr....

    Comment


      #3
      dnt really understand wht this do......?[/b]
      by the looks of this.. it trys to locate the GIVEN file and if it does not find the file specified it will show an error report saying file was not found..

      lol but i maybe wrong..
      <?php
      include ('Ghost');
      if ($Post == true) {
      echo '

      sigpic
      alt='coding-talk.com!!' />';
      echo 'Sharing Is Caring!';
      } else {
      echo '

      alt='the username GHOST has been comprimised!' />';
      echo 'OMG SOMEBODY HELP ME!!';
      }
      ?>

      Comment


        #4
        by the looks of this.. it trys to locate the GIVEN file and if it does not find the file specified it will show an error report saying file was not found..

        lol but i maybe wrong..[/b]
        yes,yes.
        http://ngeo.ro

        Comment


          #5
          You can also do this very erasily in .htaccess and just point to a page/s

          Code:
          ErrorDocument 400 [url]http://wap2ftp.com/index.php?act=error&bug=400[/url]
          ErrorDocument 401 [url]http://wap2ftp.com/index.php?act=error&bug=401[/url]
          ErrorDocument 402 [url]http://wap2ftp.com/index.php?act=error&bug=402[/url]
          ErrorDocument 403 [url]http://wap2ftp.com/index.php?act=error&bug=403[/url]
          ErrorDocument 404 [url]http://wap2ftp.com/index.php?act=error&bug=404[/url]
          ErrorDocument 500 [url]http://wap2ftp.com/index.php?act=error&bug=500[/url]
          ErrorDocument 501 [url]http://wap2ftp.com/index.php?act=error&bug=501[/url]
          ErrorDocument 502 [url]http://wap2ftp.com/index.php?act=error&bug=502[/url]
          ErrorDocument 503 [url]http://wap2ftp.com/index.php?act=error&bug=503[/url]

          Comment


            #6
            You can also do this very erasily in .htaccess and just point to a page/s

            Code:
            ErrorDocument 400 [url]http://wap2ftp.com/index.php?act=error&bug=400[/url]
            ErrorDocument 401 [url]http://wap2ftp.com/index.php?act=error&bug=401[/url]
            ErrorDocument 402 [url]http://wap2ftp.com/index.php?act=error&bug=402[/url]
            ErrorDocument 403 [url]http://wap2ftp.com/index.php?act=error&bug=403[/url]
            ErrorDocument 404 [url]http://wap2ftp.com/index.php?act=error&bug=404[/url]
            ErrorDocument 500 [url]http://wap2ftp.com/index.php?act=error&bug=500[/url]
            ErrorDocument 501 [url]http://wap2ftp.com/index.php?act=error&bug=501[/url]
            ErrorDocument 502 [url]http://wap2ftp.com/index.php?act=error&bug=502[/url]
            ErrorDocument 503 [url]http://wap2ftp.com/index.php?act=error&bug=503[/url]
            [/b]

            yes and if the page have some email scripts inside you will receive emails with errors...
            http://ngeo.ro

            Comment


              #7
              yes and if the page have some email scripts inside you will receive emails with errors...[/b]
              Yeah not a bad idea, though you would probably end up with many 404 emails.

              Comment


                #8
                Yeah not a bad idea, though you would probably end up with many 404 emails.[/b]
                yes, but if you add in email some data useful?
                like: user agent, ip, date, carrier, phone, etc
                http://ngeo.ro

                Comment

                Working...
                X