110mb.com Forum
News: Box14 mystery hardware issue. RESOLVED. | Box13 is currently down. Replacing bad drives, adjusting hardware. Should be all done by 21st Aug (no more downtimes).
 
*
Welcome, Guest. Please login or register.
Did you miss your activation email?
August 20, 2008, 06:36:32 PM


Login with username, password and session length


Pages: [1]   Go Down
  Send this topic  |  Print  
Author Topic: How do I set up a file that displays unparsed php files on my server?  (Read 48 times)
gamerz101
Member
*
Offline Offline

Posts: 3


WWW
« on: July 25, 2008, 05:05:50 AM »

I want to set up a file that will show the unparsed source of php files located on my site.

#####.com/thesourceviewer.php?=sourcewanted
Logged
inp o҉rtb
The Gangsta
Global Moderator
Official 110mb Guru
*****
Online Online

Posts: 9591

experimental theologian


WWW
« Reply #1 on: July 25, 2008, 05:14:47 AM »

Just send the source to the browser:
Code:
<?php if(isset($_GET['sourcewanted'])) { readfile(__FILE__); die; } ?>
« Last Edit: July 25, 2008, 05:32:09 AM by inp o҉rtb » Logged


blog | my work @ deviantART | please add your hardware/software to the universal compatibility center.
gamerz101
Member
*
Offline Offline

Posts: 3


WWW
« Reply #2 on: July 25, 2008, 05:21:44 AM »

I'll try it out, thanks.

Erm, what do I have to enter in the browser once I upload that code?
Logged
inp o҉rtb
The Gangsta
Global Moderator
Official 110mb Guru
*****
Online Online

Posts: 9591

experimental theologian


WWW
« Reply #3 on: July 25, 2008, 05:31:50 AM »

That just makes your script show its source when sourcewanted is set in the URL. So add it to the script you want. You can modify it to fit your needs, but that's the basic idea.
Logged


blog | my work @ deviantART | please add your hardware/software to the universal compatibility center.
gamerz101
Member
*
Offline Offline

Posts: 3


WWW
« Reply #4 on: July 25, 2008, 05:33:30 AM »

Oh, I see. Thank you.  smiley
Logged
bind
just a man
Authority Member
****
Online Online

Posts: 558


« Reply #5 on: July 25, 2008, 08:01:53 AM »

source display with syntax highlighting:

Code:
<?php
highlight_file
("filename.php");
?>

« Last Edit: July 25, 2008, 08:03:47 AM by bind » Logged

"... if you give a man a fish, he eats today ... if you teach a man to fish, he eats for the rest of his life ..."

That means I am not here to do your work for you, but to assist you in learning how to code what you need. If you want someone to code for you, hire someone to do it or use an out of the box app. All unsolicited pm's are deleted without reading.
Pages: [1]   Go Up
  Send this topic  |  Print  
 
Jump to:  

  Powered by SMF 1.1.5 | SMF © 2006-2008, Simple Machines LLC

Theme by Dilber MC | Using SEO4SMF Mod

All content on this forum (especially posts) is copyright property of 110mb & the member
who wrote the post. So if you wish to steal anyone's post on this forum, you'll wish you
were dead because our lawyers will sue your ass!