SitePoint Sponsor

User Tag List

Results 1 to 3 of 3

Thread: Source Code...

Hybrid View

  1. #1
    <? echo "Kick me"; ?> petesmc's Avatar
    Join Date
    Nov 2000
    Location
    Hong Kong
    Posts
    1,508
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    How can I use PHP to show the source code of a page.

    EG
    http://www.mysite.com/source.php?page=article.php

    Then it shows the soruce for that page?

  2. #2
    SitePoint Wizard
    Join Date
    Jul 1999
    Location
    Chicago
    Posts
    2,629
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You can see how php.net does it, here: http://php.net/source.php?page_url=/source.php and how DevShed does it, here: http://www.devshed.com/Source/index....rce/index.html .

    Hope this helps...

  3. #3
    Dumb PHP codin' cat
    Join Date
    Aug 2000
    Location
    San Diego, CA
    Posts
    5,460
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Basically in your apache conf file you have aline that says
    AddType application/x-httpd-php-source .phps

    Then you save a file called whatever.phps inyour browser you will see the color-highlighted source code. I am sure you can pull off something like what devshed and php.net do with a little coding.
    Please don't PM me with questions.
    Use the forums, that is what they are here for.


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
  •