Tell me more ×
Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free, no registration required.

I've written a patch for a GPL'ed JavaScript library. To check how the patch works one needs sample CGI (or PHP) backend.

I want to write a demo PHP to show that my JS works and put the open code on my site.

The question: What it the best way to have PHP on server both executed and viewed as the source?

Note that recently I have ordered a Virtual Private Server with a 5 Gb disk, so there are no troubles with installing new software (if any needed) for me.

share|improve this question

1 Answer

The official PHP website itself , I believe, is a good example.

For every page, you have a link to its source code at the bottom of it. For example the download page has its source available publicly; by the way, the page which displays the source can display its own source as well.


As a side note, while the concept of showing both the runtime result of the page and its source code is interesting on php.net, make sure to watch only the concept itself, not the source code of the downloads page. After browsing it, I'm quite surprised about how terrible it is.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.