Search:  

 
 
   All ForumsHot TopicsGallery






how-to block ads


 
Forums » Tech and Talk » OS and Software » Webmasters and Developers » Saving values on a web server...
Search Topic:
Share Topic:
RSS topic:
toggle:
flat / full
normal / watch
Posting:
Post a:
Post a:
Javascript - parse xml string »
« Not sure why?  
AuthorAll Replies


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 See Profile :

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
Forums » Tech and Talk » OS and Software » Webmasters and DevelopersJavascript - parse xml string »
« Not sure why?  


Saturday, 28-Nov 22:20:46 Terms of Use | Privacy Policy | Hosting by www.nac.net - DSL,Hosting & Co-lo | feedback | contact
over 10 years online! © 1999-2009 dslreports.com.
page compression OFF
Most commented news this week
· [122] Time Warner Cable Fires Broadside At Broadcasters
· [112] New AT&T Ad Campaign Hits Back At Verizon
· [96] Apple Joins AT&T Verizon Snark Fest
· [87] New Bill Takes Aim At Higher Verizon ETFs
· [80] TiVo Sees Record Customer Losses
· [71] Weekend Open Thread
· [70] Verizon CEO: Hulu Will Be Dead Soon
· [69] In-Flight Internet Headed For Bumpy Landing?
· [62] Thanksgiving Open Thread
· [40] EFF Wages War On Fine Print
Most people now reading
· Windows 7 boot manager editing questions [Microsoft Help]
· [How to] Install Asterisk on an Asus WL-520GU router [VOIP Tech Chat]
· [Newsgroups] Newzleech down? [Filesharing Software]
· 3.x Feral Druid - Bear Tanking Guide [World of Warcraft]
· Why does it take so long? Mail question [General Questions]
· Why would I want an e reader? [General Questions]
· ToC 4th boss - Preliminary Strategy for Twin Valkyr [World of Warcraft]
· [ PVP] 3.2 DK PvP D/W Spec... [World of Warcraft]
· Digital Transport Adapter Unboxing Photos [Comcast Cable TV]
· [ Classes] Druid tanking: rotation and glyphs [World of Warcraft]