get data from html form and write into a file, javascript, get data from html form and write into a file, javascript |
get data from html form and write into a file, javascript, get data from html form and write into a file, javascript |
Daralis |
Apr 25 2012, 05:47 PM
Post
#1
|
Group: Members Posts: 5 Joined: 25-April 12 Member No.: 16,984 |
Im trying to write data retrieved from html form, but can't make it work. Please help me. Iam a newbies to this.
Thanks so so much. <script LANGUAGE="JavaScript"> function Write(input0, input1, input2) { var Scr = new ActiveXObject("Scripting.FileSystemObject"); var CTF = Scr.CreateTextFile("employeefile.txt", 1, true); CTF.WriteLine(input0 + ","+ input1 + ","+ input2); CTF.Close(); } function validateForm() { var x1=document.userform.pwd.value; var x2=document.userform.re_pwd.value; if (x2 == x1) { document.write(document.userform.empname.value) Write(document.userform.empname.value, document.userform.user.value, document.userform.pwd.value); } else { alert("Passwords are not the same, Re-enter password"); } } </SCRIPT> </head> <body> <table width=100% border="0"> <tr> <td style="background-image:url(http://farm8.staticflickr.com/7092/7114162767_1c07772c85.jpg); background-size:cover;"> <p style="font-family:Britannic Bold;font-size:180%;color:#3300FF;text-align:center;"> <br /><br /> REGISTER </p><br /> </td> </tr> <tr> <td style="background-color:#EEEEEE;height:700px;background-size:cover;text-align:center;"> <form ACTION="" NAME="userform" METHOD="GET" ONSUBMIT="return validateForm()">Create employee profile: <BR><br /><br /> Employee Name: <input type="name" name="empname" size="35"/><br /><br /> Username: <input type="logintext" name="user" size="35"/><br /><br /> Password: <input type="password" name="pwd" size="35"/><br /><br /> Re-enter Password: <input type="re_password" name="re_pwd" size="35"/><br /><br /> <input type="submit" value="Submit" size="35"/> </form> </td> </tr> <footer> <tr> <td colspan="2" style="background-color:#FFA500; width:100%; height=50px; text-align:center;"> Copyright © 2012 QGS Inc. </td> </tr> </table> </footer> </body> </html> This post has been edited by Daralis: Apr 25 2012, 06:27 PM |
Christian J |
Apr 27 2012, 12:03 PM
Post
#2
|
. Group: WDG Moderators Posts: 9,656 Joined: 10-August 06 Member No.: 7 |
BTW, how much do you have to lower MSIE's security settings for this to work? And can you rewrite any text based file on the user's computer?
|
pandy |
Apr 27 2012, 12:41 PM
Post
#3
|
🌟Computer says no🌟 Group: WDG Moderators Posts: 20,730 Joined: 9-August 06 Member No.: 6 |
I didn't lower anything, just has to OK the active-x prompt. But that could be different depending on your settings and version of IE I guess.
I guess you can overwrite any existing file since I overwrote the one I created several times. |
Christian J |
Apr 27 2012, 02:43 PM
Post
#4
|
. Group: WDG Moderators Posts: 9,656 Joined: 10-August 06 Member No.: 7 |
I didn't lower anything, just has to OK the active-x prompt. But that could be different depending on your settings and version of IE I guess. Do you view the HTML file with the script from your local file system? The latter's security zone seems to have low security, but can't be viewed/changed unless you make changes to the registry: http://surfthenetsafely.com/ieseczone3.htm Can't believe scripts are allowed access to users' file system in the Internet Zone. If it was this easy to hack Windows with javascript there would be an, err, pandemic. |
pandy |
Apr 27 2012, 03:59 PM
Post
#5
|
🌟Computer says no🌟 Group: WDG Moderators Posts: 20,730 Joined: 9-August 06 Member No.: 6 |
Of course it's local and didn't make any registry changes. Don't you have your own IE by the way?
|
Christian J |
Apr 28 2012, 07:52 AM
Post
#6
|
. Group: WDG Moderators Posts: 9,656 Joined: 10-August 06 Member No.: 7 |
Of course it's local and didn't make any registry changes. You don't need any registry changes, except for examining the local system's security settings. QUOTE Don't you have your own IE by the way? I just wanted to know how dangerous MSIE really is. With your interest in activeX you seemed like an excellent guinea pig. |
pandy |
Apr 28 2012, 08:38 AM
Post
#7
|
🌟Computer says no🌟 Group: WDG Moderators Posts: 20,730 Joined: 9-August 06 Member No.: 6 |
You said above that registry changes were needed, or so I thought.
|
Lo-Fi Version | Time is now: 23rd April 2024 - 03:03 AM |