Pass values from Javascript to PHP

Discussion in 'Javascript' started by Thomas, Apr 24, 2006.

  1. Thomas

    Thomas Guest

    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
     
    Thomas, Apr 24, 2006
    #1
    1. Advertising

  2. Thomas

    ASM Guest

    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>
    --
    Stephane Moriaux et son [moins] vieux Mac
     
    ASM, Apr 24, 2006
    #2
    1. Advertising

  3. Thomas

    Tim Williams Guest

    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.


    "Thomas" <> wrote in message news:...
    > 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
    >
     
    Tim Williams, Apr 24, 2006
    #3
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Rajive Narain
    Replies:
    0
    Views:
    2,066
    Rajive Narain
    Sep 18, 2009
  2. Replies:
    1
    Views:
    190
  3. eastcoastguyz
    Replies:
    1
    Views:
    123
    Flamer
    Jul 11, 2006
  4. Replies:
    3
    Views:
    235
    frothpoker
    Sep 4, 2006
  5. __
    Replies:
    1
    Views:
    131
    Gregor Kofler
    Oct 2, 2007
Loading...

Share This Page