Pass values from Javascript to PHP

T

Thomas

Sorry if this is a really obvious question but I am new at this. I
would like to have my javascript pass some variables it gets to a php
page I have to log the inputs. The inputs are collected in forms but I
want the logging to be completely hidden from the user. Any
suggestions?
Thanks
 
A

ASM

Thomas a écrit :
Sorry if this is a really obvious question but I am new at this. I
would like to have my javascript pass some variables it gets to a php
page I have to log the inputs. The inputs are collected in forms but I
want the logging to be completely hidden from the user. Any
suggestions?

J'ai rien compris!

From where come your JS variables ? (php write them ?)

The new values for these variables has to be put in inputs ?

document.forms[0].elements['hide_1'].value = myVariable;

but you can't hide your javascript ...


<form action="form_querry.php" method="post">
<p>Name : <input type=text name="name">
<p>Password : <input type=password name="pass">
<input type=hidden value="" name="hide_1">
<p><input type=submit value="OK">
</form>
 
T

Tim Williams

var i = new Image();
i.src="h ttp://someserver.com/somedir/logging.php?blah=" + myJsVar;


Might want to encode your variables before sending...
Maybe also add another (random) querystring parameter to avoid caching.
Tim.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top