Jump to content

Recommended Posts

OK, I don't want to write my own code...yet.
I just want to see how this particular file was made, along with .php tags and I wonder if that is possible.
I downloaded Editpad cuz supposely they'd show the code but I just saw the HTML output.I uploaded the file on Ripway.com, cuz they support PHP but they also showed html output in their 'edit' section.

Is there anything that will acctually show the code of the .php file and can be downloaded for free?
Link to comment
https://forums.phpfreaks.com/topic/4357-viewing-php-file-as-php-code/
Share on other sites

[!--quoteo(post=352598:date=Mar 7 2006, 03:17 PM:name=fluffycat)--][div class=\'quotetop\']QUOTE(fluffycat @ Mar 7 2006, 03:17 PM) [snapback]352598[/snapback][/div][div class=\'quotemain\'][!--quotec--]
OK, I don't want to write my own code...yet.
I just want to see how this particular file was made, along with .php tags and I wonder if that is possible.
I downloaded Editpad cuz supposely they'd show the code but I just saw the HTML output.I uploaded the file on Ripway.com, cuz they support PHP but they also showed html output in their 'edit' section.

Is there anything that will acctually show the code of the .php file and can be downloaded for free?
[/quote]

is this a file you have a local copy of? if it is, just open it in any text editor, and you can see the source code. if it is a file on a server somewhere, there is no way to just "view the file." you'd have to get the author of the file to print out the source for you with something like highlight_file() or some other function like that.
[!--quoteo(post=352600:date=Mar 7 2006, 09:19 PM:name=obsidian)--][div class=\'quotetop\']QUOTE(obsidian @ Mar 7 2006, 09:19 PM) [snapback]352600[/snapback][/div][div class=\'quotemain\'][!--quotec--]
is this a file you have a local copy of?[/quote]

Yes, I have the copy of it, but I tried with Notepad and with Editpad and all they show is the HTML output, just like it would be showed if I opened it with IE ->View source.

LOL, you mean the author should write it for me again and save it as text file and send it over.
I meant to figure it without his knowledge...

EDIT:
I don't have anything PHP related installed on my PC cuz I don't need it...or do I? I DUNNO!!!
May I add a few things?

Just because a file is named file.php, does not mean it contains PHP, only that it CAN contain PHP. I call ALL my file xxx.PHP so if I want to add php later, I can with a minimum of problem.

Also,

Even thought PHP is server side, I have noticed that from time to time, for reasons I don't understand, the PHP file ends up in my web cache... you might look there... (If you want to say I'm wrong, fine, but I write PHP, so I know PHP when I see it LOL)

Perhaps this is a good opportunity for you to learn and write your own code... This is a good place to start your learning!
I know that is a php file cuz when I give it a command, it displays different output.
For eg, I have created a HTML file that has this kind of command:

a href='file.php?display=daisies'

and it does. But that is a wild guess, I want to know all other commands in that php file without me guessing them. Cuz right now, what I need for figuring that file is something I can't tell if it's part of JavaScript or DoMath or something else, or it may be two words of php code....it will take me ages to figure it...and I want to know it NOW, not in a few months...

So if there is no way I see it in a php way, tell me immediatelly so I don't waste my time on hoping for it...
If you are not a scripter/programmer then reading the source code may not be as easy as you hope first of all. If you, additionally, are not fluent with HTML or have not reviewed the file completely then you can not be sure it is just purely the HTML output as HTML can be contained in the PHP or PHP can be encapsulated in the HTML. PHP (PHP: Hypertext Preprocessor) is simply the portion of the file which is processed by the interpreter on the server before the output is passed to the end-user's browser. That's why it is refered to as "server-side scripting", because it is handled on the server before it reaches the client. The output to the browser is usually derived from the result of the actions taken on the server-side before output is generated and passed to the browser. If you open your browser of choice and view the source of the page with .php extension you will not see the source code for the PHP file and no program will reveal the hidden code because there isn't any hidden code. All you have is the output that was left over once all the PHP was pulled out of the file and executed. Now for the thing that will really throw you off...(sorry not trying to overwhelm you or anything merely inform)...if the server is configured for it, a .html file could contain PHP and execute it just as if it were a .php file. This can usually be done with the server's primary configuration files or with .htaccess files if the server allows that sort of modification from a .htaccess file. This is generally not the case, but in rare instances I have seen people change the server configuration or use the .htaccess files to do this. Beyond this I can not really off any solution other than post the code somewhere so people can view the source (http://www.nomorepasting.com) or here in the forum provided the moderators do not have any objections. First make sure there are no passwords or other sensitive information in the file before you post it anywhere then ask for some help and perhaps someone with more experience than yourself can help you decipher the contents.

Happy coding!
If you mean open the file to look at the lines of code, yes. You need a program called TEXTPAD or any other of a zillion text editors.

If you men open the file and LET IT RUN, you need to INSTALL PHP on your system. You DON'T need a webserver, (But it's easier if you do), as PHP can run from the command line in Windows and I assume Linux.

Keep in mind: I am not sure if you have the actual PHP file or you are referring/linking to someone elses PHP and you are wanting to know what they are doing when you link to their code.

If the second is true, you may not be able to know what they are doing, unless they send you the actual PHP file. if the first is true, then please paste the code on the forum here and I'm sure you will get lots of help interpreting the code.

[quote name='fluffycat' date='Mar 8 2006, 06:56 AM' post='352803']
[b]My question: Is there a standalone program that can enable to open an existing .php file along with .php code, yes or no.
I have THE file and don't need to know what each line of code does, nor run it on my PC.

If I post THE code, you'll get one really poor HTML 3,2 with zillion of deprecated tags that I need no explaination at all as I know them.

Will download Textpad and let you know if that is what I needed. Thanks for help!!!



Downloaded Textpad.
Opened file.
Shows HTML code that I could get with Notepad.
Not what I needed.
***
Since nobody was able to give me the yes/no answer on my question and after downloading two programs that I do not need, I'll accept that there's no way that I could open that file.

I'll no longer visit this board so don't bother to reply.
Thanks for trying to help me out.

I got a feeling that he was going to some website and going to FIle -> Save as and then opening the page in what ever editor he or she was using. If he did that then he would of just downloaded the ouput! And not the php source code! You cannot download the source coude of a website unless you have FTP access to the file.
Actually, When I told him to download TEXTPAD, I was being cynical... I didn't really expect him to do it LOL...

I think he was trying to figure out how to link to someone elses site, but needed to PHP to make it all work... I don't mind people harvesting my data, but please, don't LINK my data !!!
*sigh* you try to properly answer someone's question and to what end? fluffycat thought they had a yes/no black and white question, but they couldn't see the big grey area right in front of them. You can't have the solution without some understanding of the problem first. If you do not understand the problem, how are you sure it is a problem and how will you know when you reach the solution?
This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.