Pass data using POST method

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • ajmerasunny
    New Member
    • Mar 2008
    • 4

    Pass data using POST method

    Hi,

    I have following task to implement:

    I have to pass username and password from first html page to second html page using POST Method and automatically submit the second html page on loading.

    Please help.


    Thank you
  • realin
    Contributor
    • Feb 2007
    • 254

    #2
    Originally posted by ajmerasunny
    Hi,

    I have following task to implement:

    I have to pass username and password from first html page to second html page using POST Method and automatically submit the second html page on loading.

    Please help.


    Thank you
    There are two way to pass the data from one html to another..
    1) Hidden Fields (POST & GET)
    2) Cookie

    then on second page you can have a script under the condition
    [PHP]
    if($_POST){
    //your submission code
    }

    regards
    Realin !

    Comment

    • acoder
      Recognized Expert MVP
      • Nov 2006
      • 16032

      #3
      Originally posted by ajmerasunny
      I have to pass username and password from first html page to second html page using POST Method and automatically submit the second html page on loading.
      If the second page is an HTML page, you won't be able to use POST. The POST method can be only be used for a server-side scripting page unless nothing is actually posted.

      Why submit the second page automatically? Why not have hidden fields on the first page instead? Can you explain the problem in more detail.

      Comment

      Working...