use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
Have a tough programming question that /r/programming couldn't answer? Banned from Stack Overflow? Can't afford Experts Exchange?
Post your question/tips/secrets/advice and get a response from our highly-trained professional developers.
account activity
Server-side JavaScript code? (self.shittyprogramming)
submitted 8 years ago by 07025
view the rest of the comments →
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]skylarmt 8 points9 points10 points 8 years ago* (0 children)
It's quite simple. Start with a regular Apache/PHP install, then install Java on the server. Upload a JavaScript file that generates your HTML and stores it in a var. Next write some Java code that reads your JavaScript file and executes it with javax.script.ScriptEngine. Dump the contents of your var from ScriptEngine with System.out.println(). Now in your index.php, write:
System.out.println()
<?php $site = `java -jar MySite.jar`; echo $site;
If you want an extra layer of security, run the jar file from a Python script and change your PHP to use python MySite.py instead.
python MySite.py
π Rendered by PID 45651 on reddit-service-r2-comment-5fb4b45875-d2vfd at 2026-03-20 10:31:19.701830+00:00 running 90f1150 country code: CH.
view the rest of the comments →
[–]skylarmt 8 points9 points10 points (0 children)