Possible to pass variable without forms through POST?

Discussion in 'PHP' started by resting, Jun 29, 2009.

  1. #1
    Hi guys, just want to know if its possible to pass variable to another page without assigning them as a hidden form object by using the Post method.

    Post is supposed to be more secure since the url doesn't display the passed values, but anyone viewing the source code of the page should be able to look what had been passed in the <input type="hidden"> tags.

    Currenly I only know of using forms as hidden values to pass them. Pls enlighten me with other more secure methods. thanks
     
    resting, Jun 29, 2009 IP
  2. e2developer

    e2developer Peon

    Messages:
    31
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #2
    You can use session or cookies to pass variables on other pages or you can encrypt the data in hidden
    fields so that anyone can not see the values in voew source.
     
    e2developer, Jun 29, 2009 IP
  3. jestep

    jestep Prominent Member

    Messages:
    3,659
    Likes Received:
    215
    Best Answers:
    19
    Trophy Points:
    330
    #3
    Do you control the page that is being posted to? If so, you can use some sort of temporary storage, database, sessions, etc. to store the variables so your user's can't see or access them. There's no way to inject variables into a request while the user is posting.
     
    jestep, Jun 29, 2009 IP
  4. Goramba

    Goramba Peon

    Messages:
    128
    Likes Received:
    8
    Best Answers:
    0
    Trophy Points:
    0
    #4
    session_start();
    $_SESSION['test'] = true;
    if($_SESSION['test'] == true){
    // do stuff
    }
     
    Goramba, Jun 29, 2009 IP