Kryllster Posted February 13, 2010 Share Posted February 13, 2010 I am wanting to do something with server side javascript running in Firefox POW that is related to php as it seems I cant get php to work in POW anymore. here is the php code: <?php $show = (!isset($_GET['show'])) ? 'main' : $_GET['show']; // start include('header.php'); switch($show) { case 'fight_failure': include('dungeon1/fight_failure.php'); break; case 'fight_failure2': include('dungeon1/fight_failure2.php'); break; case 'fight_failure3': include('dungeon1/fight_failure3.php'); break; case 'fight_success': include('dungeon1/fight_success.php'); break; case 'fight_success2': include('dungeon1/fight_success2.php'); break; case 'main': default: include('dungeon1/room1.php'); break; } // End include('footer.php'); ?> Can this be done with sjs or not was just wondering and where can I find reliable sjs websites the one I went to tried to put a trojan on my machine. Thanks in advance, Quote Link to comment https://forums.phpfreaks.com/topic/191991-is-this-allowed-here/ Share on other sites More sharing options...
Zane Posted February 14, 2010 Share Posted February 14, 2010 acronyms are good only for a community that uses them. POW? SJS?.. You can't just put an acroynm out there and expect people to know what is it.. For example: My first vision when I see POW is .. Prisoner of War. ..and for SJS,...mmm.. idk I'd just assume it was some sort of CMS (acronym drop, Content Management System; I can't be hypocritical). Super Javascript Server?.. i don't know, I haven't googled it yet. As for your code? are you getting errors; is it "not working";... What's the problem? Quote Link to comment https://forums.phpfreaks.com/topic/191991-is-this-allowed-here/#findComment-1011986 Share on other sites More sharing options...
Kryllster Posted February 14, 2010 Author Share Posted February 14, 2010 Sorry I didnt make myself more clear I am wanting to use that php code but with server side javascript "sjs". And Firefox POW is a Firefox extension for Plain Old Webserver. Its supposed to run php however I am having problems so I thought if I could convert some php code to sjs that would be better. Hope that helps?? https://addons.mozilla.org/en-US/firefox/addon/3002 Quote Link to comment https://forums.phpfreaks.com/topic/191991-is-this-allowed-here/#findComment-1011989 Share on other sites More sharing options...
salathe Posted February 14, 2010 Share Posted February 14, 2010 The SJS that you want to use is just plain old JavaScript (with a few variables/objects pre-defined to make life easier[1]). You just need to use: pow_server.GET in place of $_GET A regular JS switch statement just like PHP pow_include() in place of include() [1] http://davidkellogg.com/wiki/Main_Page Quote Link to comment https://forums.phpfreaks.com/topic/191991-is-this-allowed-here/#findComment-1012041 Share on other sites More sharing options...
Kryllster Posted February 15, 2010 Author Share Posted February 15, 2010 Well I tried this little piece of code and it says it can find index.sjs? <?sjs $show = pow_server.GET['show']; // start pow_include('content/header.html'); // content below switch($show) { case 'family': pow_include('content/family.html'); break; case 'mach12': pow_include('content/mach12.html'); break; case 'links': pow_include('content/links.html'); break; case 'interests': pow_include('content/interests.html'); break; case 'hawkspirit': pow_include('content/hawkspirit.html'); break; case 'strack': pow_include('content/strack.html'); break; case 'main': default: pow_include('content/main.html'); break; } // End pow_include('content/footer.html'); ?> Any references on the net about this other than what was posted Im looking but can;t find anything? Quote Link to comment https://forums.phpfreaks.com/topic/191991-is-this-allowed-here/#findComment-1012382 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.