I'm a beginner programmer and I'm developing this web app, nothing major; the hardest part was writting to text file (not really hard...)
Anyways, my company policy doesn't allow us to install server softwares on computers. So now, I can't run the PHP code I wrote!!
I am wondering if there is anyway I can run PHP without installing or running any sort of server software.. Like I said, I'm using only the file read/write functions and the include() function. Everything else is XHTML
If there is no way the above can be done; what language can I use to read/write files without needing some sort of server?
Thanks, just point me in the right direction, I'll figure out the rest!
from the directory with the files to test and you can browse them. Said this, with every programming language you can open a socket and serve data. If there is a problem with restrictions, why not setup a firewall in the working station and block the ports?
Yeah I can access that website & use a USB webserver; but the thing is, I'm making this app for people who barely know how to use Excel. So I have to make it as dumb as possible! That's why I am looking for ways to replace code like
<?php include($datadir."generic_name.txt"); ?>"/>
with something that people can just run as "offline website"
<iframe style="display:none;" id="myIframe" src="/pathtofolder/textfile.txt"></iframe>
<a href="#" onclick="getContentFromIframe('myIframe')">Get the content</a>
var myIFrame = document.getElementById(iFrameName);
var content = myIFrame.contentWindow.document.body.innerHTML;
document.getElementById('display').innerHTML = content;
You can use another function to change the src attibute value (i.e. change file). Again you don't need a link, you could use a dropdown which loads data (particular file) as you change the value.
For added goodies, you could use the jQuery and jQueryUI and rerlated CSS CDN references (e.g. from Google) to really spark up your site - no server required. Alternatively, download them and use them locally.
However, writing to files is another matter - I'm not sure that this is do-able with js
From what I gather, it can only be done via ActiveX (IE) using fso. But this IMO could be a security issue if the site was open to the wild, ie accessible to others. But there again if somebody got into your computer, they'd do enough damage without trying to mess with your files through a webpage.
//this can be put into a function
var fso = new ActiveXObject("Scripting.FileSystemObject");
FO = fso.OpenTextFile("C:\\diafol.txt", 2, true,0);
FO.write("See if this works");
<p>Just some random text - could be used to report on file handling progress / reponse</p>
This works for me under Internet Explorer - although you may need to allow ActiveX and scripts to run in the browser. So you could use this as opposed to the iframe nonsense.