Something about using php with JS

Discussion in 'Programming' started by asmon, Apr 5, 2008.

  1. #1
    I have a PHP page where a few variables are being.
    Then i need to send those variables back to the server using AJAX.
    I can't allow the user modify those variables, therefore if i use 'GET' to store
    them in the URL they can obviously be changed.
    i don't know where the 'POST' information is being saved but i think
    you can also modify it somehow.

    Is there a way to store this information in the page so i can send it again
    using AJAX without a risk for someone changing it?
     
    asmon, Apr 5, 2008 IP
  2. Technica

    Technica Active Member

    Messages:
    624
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    53
    #2
    Have you tried using the hidden control for storing the values.

    Also if the page is using any form tag like <form method="post" action=""> some code </form> then you can see on which page the post information is sendfrom the action tag of the form. OR if not then search for Javascript code that is setting the action tag for your form becoz we can set the action tag for a form through javascript also.

    for e.g. if your form name is myform then look for javascript code that says

    myform.action=somepage name


    I hope that helps you.
     
    Technica, Apr 5, 2008 IP