A http server (like on-rev) needs to always return something. making that something (as in your case) be "<html></html>" seems to be rather unusual and nondescript, but should work. still you might want to check "the result" in your rev stack, to make sure the script on the server actually works as expected.

Also, you're missing validation and security. anyone can write anything into your text file, if he or she wants to, and sooner or later they will. If there are a lot of users (hundrets per second), you might also run into the problem of some text not being stored in the file, because another user overwrites the first change (competing file access).

Note that there's script errors in your supplied example, so i guess you're missing those too. For example "URL:" in the irev file should of course be "URL", and probably i'm missing some too :)

A file created by you might not be accessible to the process the web server runs at (unix user handling and file access restrictions). But this is more a "what if everything else is correct and it still fails unexpectedly" scenario.

If things don't work, try to return stuff. for example putting the data into the text field might fail, and then "the result" would contain useful information so you might want to return that:
put the result

i think that setting the clipboard, without the user demanding it, is evil, and should never be done (ever).

On 16 Dec 2009, at 22:06, John Patten wrote:

Hi All!

I have a little rev project that I will eventually turn into a webRevProject. I would like to have this little webRevProject project store a line of text into an on-rev text file. I'm not quite getting it right...

Here are the three parts that I have:

1. Rev Projects  Script

put theSentence & " -created in " & totalTime & " seconds" into theSentence
  set the clipboardData["text"] to theSentence
  put "sentence" & "=" & urlEncode(theSentence) into tMyPostData
post tMyPostData to URL "http://jpatten.on-rev.com/xmas/saveSentence.irev "

2. SaveSentence.irev

<html>
<?rev
put $_POST["sentence"] & return after URL: "file:sentence.txt"
?>
</html>


3. sentence.txt  (a blank text file waiting to be written to)



Is there something I missed?

Thank you!

John Patten






_______________________________________________
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution

_______________________________________________
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution

Reply via email to