1

I have php made website. It runs on windows machine. I have a javascript that i have tested that gets me the adobe version used by clients. The problem is that by running the code I'm able to retrieve the Adobe Reader version but cannot saved the output to a file on my server end.

Here is the Javascript code. I took this code from sister stackexchange website.

http://jsfiddle.net/EGbY5/3/

What is the best way to save this information from js? Should i use js or any other scripting? I read this from google that you cannot use js to save files on server? If this is true is there any other way.

2 Answers 2

1

I would suggest using AJAX (or a form, if you want the user to explicitly know this is happening) to send a request to your server side code detailing the information you have collected with the script.

The advantage of AJAX is that you can do all of this without the user being explicitly aware of it. The disadvantage is that you rely on their browser supporting Javascript, but since you are already collecting information using Javascript this problem is mute.

Sign up to request clarification or add additional context in comments.

3 Comments

@hatidiotguy thanks ajax lot of guys recommended me this. But i'm new to ajax is there a demo or nice tutorial you can sent.
google ajax Results found infinity. You can use JQuery or another library, or pure Javascript. Your choice. The code to do that is a separate question, and as always you will need to provide code that shows you attempted this.
i got this now. Thanks for being so clear. I would go work now. Thanks.
0

Ajax'll do it.

JavaScript source:

var adobeVersion = CheckAdobeVersion();
$.post("script.php", {version: adobeVersion}, function(){});

PHP source:

<?php
  $version = $_POST['version'];
  write all text to a file("my file.txt") // Pseudo code...
?>

3 Comments

This answer assumes he is using JQuery, which is not necessarily true.
Alright then.. Use a plain XMLHttpRequest. The post still stands, just change the $.post() to the primitive XMLHttpRequest logic. PHP code is still valid.
Now if it works for jquery i wanna stick with this code. I just read that use of XMLHttpRequest is more dependent on the browser. I wish for more functionality and general use. I like to use your code

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.