...

View Full Version : Remote acces to Javascript (online ??) PLEASE HELP :(



Mr. DJ
12-29-2005, 01:21 PM
Hi there people... i dont know if this is the right place to post this but hey... you mod's can always move this ^^

Oke i got a question...

Lets say i got a javascript file (nopcart.js)
In this javascript file in the first 50 lines, there ar e a buch of variables.

Is it possible (i DO think that it is) to change those variables from the website itself, on a kinmda damin page... so lets say i got a form on that page, and i put in numbers, and press submit... the variables in the script are changed...

Tnx (i hope)

Mr. DJ

Nischumacher
12-29-2005, 02:32 PM
i don't think it is possible.

as long as the session is alive... the variables can be given new values... once the session is over... you are back to square one.

konithomimo
12-29-2005, 05:10 PM
Javascript cannot write/change a file on your server. That can only be done via a server side script such as PHP or ASP.

Mr. DJ
12-29-2005, 08:05 PM
Javascript cannot write/change a file on your server. That can only be done via a server side script such as PHP or ASP.

so i did post this in the wrong section...

Javascript doesent need to change another file...
another file needs to change Javascript :)

jettlarue2003
12-29-2005, 08:12 PM
do you mean to actually change the file or just change the variable values? becuase they are a lot different.

Mr. DJ
12-29-2005, 08:45 PM
do you mean to actually change the file or just change the variable values? becuase they are a lot different.

well i got this file: Nopcart.js

and as example on line 75 there is this code

Brief0_20g = 0.39; // prijs bij brief 0 (ag) to 20 (bg) g in euro

what i would like is that i can with just filling in a form change the 0.39

so... thats the var not the file

konithomimo
12-29-2005, 09:15 PM
so i did post this in the wrong section...

Javascript doesent need to change another file...
another file needs to change Javascript :)

Your javascript is saved in a .js FILE . . . thus you are trying to write/change a
file on your server, which JS cannot do.

Mr. DJ
12-29-2005, 09:26 PM
Your javascript is saved in a .js FILE . . . thus you are trying to write/change a
file on your server, which JS cannot do.

and with other internet code langues? can i change with php the vaiables inside a js file? :rolleyes:

let make this clear....

-i have variables inside an javascript FILE
-i want to change them online using a formlike

-----either: can i add javasxript code to the specific file, to have a button. If u click on that button, fill in the admin password, u get an form in wich i can change the vars ( iknow how to make the table, not how to make the button and password thingie)
-----other way: using a different file with an code wich does the same


-so i dont need a javascript file, wich changes a javascript file if thats what ya mean :P ;)

konithomimo
12-29-2005, 09:33 PM
yes, server side scripts such as PHP allow you to create/read/write to a file on your server.

Mr. DJ
12-30-2005, 10:50 AM
yes, server side scripts such as PHP allow you to create/read/write to a file on your server.


http://www.codingforums.com/showthread.php?t=75818

fot those who care, i made an phph tread ^^, tnx for your time



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum