Jump to content


Photo

Random php function question


  • Please log in to reply
5 replies to this topic

#1 klitscher

klitscher
  • Members
  • PipPip
  • Member
  • 14 posts

Posted 28 February 2006 - 08:31 AM

To be honest, I can't remember if I dreamt this (dreaming about programming, such a life I have) or if it is real, but is there a function one can call to get the php code from a php file displayed in a browser...I know that you can't just save a php file and look at the code, it is all handled on the server end, but I either dreamt or read that there is a function that you can use to read the backend code for any file...and if this is so, is it only possible on localhost or can you check any url in cyberspace for it?

I apologize if i make no sense.

Ken

#2 jurass1c

jurass1c
  • Members
  • PipPipPip
  • Advanced Member
  • 57 posts

Posted 28 February 2006 - 11:39 AM

[!--quoteo(post=350170:date=Feb 28 2006, 03:31 AM:name=klitscher)--][div class=\'quotetop\']QUOTE(klitscher @ Feb 28 2006, 03:31 AM) View Post[/div][div class=\'quotemain\'][!--quotec--]
To be honest, I can't remember if I dreamt this (dreaming about programming, such a life I have) or if it is real, but is there a function one can call to get the php code from a php file displayed in a browser...I know that you can't just save a php file and look at the code, it is all handled on the server end, but I either dreamt or read that there is a function that you can use to read the backend code for any file...and if this is so, is it only possible on localhost or can you check any url in cyberspace for it?

I apologize if i make no sense.

Ken
[/quote]

rename your file to .phps

#3 klitscher

klitscher
  • Members
  • PipPip
  • Member
  • 14 posts

Posted 28 February 2006 - 03:26 PM

[!--quoteo(post=350180:date=Feb 28 2006, 04:39 AM:name=jurasipize)--][div class=\'quotetop\']QUOTE(jurasipize @ Feb 28 2006, 04:39 AM) View Post[/div][div class=\'quotemain\'][!--quotec--]
rename your file to .phps
[/quote]

Thanks for your help...for some reason I thought there was a function that could get any url and display it as code in a browser, thereby allowing one to see passwords to databases and the like. must have dreamt it. pretty pathetic. thanks again

#4 running_out_of_imagination

running_out_of_imagination
  • Members
  • PipPip
  • Member
  • 14 posts
  • LocationSouthampton, UK

Posted 01 March 2006 - 12:36 AM

Do you mean a function like highlight_file()?

#5 klitscher

klitscher
  • Members
  • PipPip
  • Member
  • 14 posts

Posted 01 March 2006 - 03:03 AM

[!--quoteo(post=350448:date=Feb 28 2006, 05:36 PM:name=Running out of imagination)--][div class=\'quotetop\']QUOTE(Running out of imagination @ Feb 28 2006, 05:36 PM) View Post[/div][div class=\'quotemain\'][!--quotec--]
Do you mean a function like highlight_file()?
[/quote]

yes i do...okay, atleast i was not dreaming...now a completely different question...do i need to be worried that i have a config file that has database username and password in it and people can read it using highlight_file()?

#6 running_out_of_imagination

running_out_of_imagination
  • Members
  • PipPip
  • Member
  • 14 posts
  • LocationSouthampton, UK

Posted 01 March 2006 - 06:58 PM

yes, maybe have the database details on a dbconfig.php and just include it on the main script. Also don't try to have highlight_file($_GET[$bar]) as people could just change the variable on the URL.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users