  Vamp 5c077 Premium join:2003-01-28 MD
·Verizon FIOS
| reply to Vamp Re: Saving values on a web server...
Ok I got PHP reading/writing to a txt file but there is an issue, this cant work because it can't be used in conjunction with Javascript statements... Not willing to rewrite everything (plus some things cant be rewrite as they are linked to another outside script).
Will probably just abandon the project. -- WLM/MSN Messenger: scott001(gmail) ADD ME! |
|
  PetePuma How many lumps do you want Premium,MVM join:2002-06-13 Arlington, VA
| If you'd provide some more detail on what's involved perhaps you'd get a better answer. You keep mentioning some existing app (though you say you aren't interested in anything in particular -- I disagree; you have a specific application in mind) but don't provide any details. There is probably a viable solution but the crumbs you're throwing aren't enough. |
|
 muiredised ESSE QUAM VIDERI
join:2007-06-11 Tacoma, WA
| reply to Vamp said by Vamp :Ok I got PHP reading/writing to a txt file but there is an issue, this cant work because it can't be used in conjunction with Javascript statements... What follows is a solution that is NOT ideal but without any details it is basically a proof of concept for you.
I write a PHP script that takes some user input, processes it, then writes it to a file in the following format:
var a = "user input"; var b = {test1:"more user input",test2:"look at me"};
The PHP script names the file "test.js" and saves in a directory that is accessible via the web. Now in your web page you include Javascript code that makes an AJAX call to »your.website.com/test.js (or wherever you saved it) and it fetches your file as a string. You eval the string and because the string is formatted as Javascript VIOLA!!! you now have data in your client side script that came from the server. Add more Javascript to use that data in whatever manner you wish, add a setTimeout to run the AJAX request at a specified interval and there you go.
I won't harp on the pitfalls of eval and what not. If you've never done anything like this before then you definitely have a learning curve ahead of you. |
|
  Vamp 5c077 Premium join:2003-01-28 MD | Wow I never thought of that, that should work... I have experience with storing values in js and property files with Javascript... Just never touched PHP before like I said. -- WLM/MSN Messenger: scott001(gmail) ADD ME! |
|
  usa2k Please PRAY for Rebekah Premium,MVM join:2003-01-26 Canton, MI clubs: | Re: Saving values on a web server...
Best jump-start I had for PHP was Here |
|