Want to use url to post the data in form.

Discussion in 'HTML' started by Hongyi Zhao, Feb 6, 2009.

  1. Hongyi Zhao

    Hongyi Zhao Guest

    Hi all,

    I want to construct a url to do the same thing that a post form done,
    e.g., username and password, is the data submitted by the form. What
    should I do then just a constructed url to do the same thing?

    Let me describe my issue in more detail:

    Take the following url as a example:

    http://proquest.umi.com/pqdweb

    My institute is a subscriber of it and I've a username and pssword of
    this library. In my case, I find that I've two choices to log into
    it:

    1- Go to the above url, and then fill the logon form by my username
    and pssword, finally, click on the connect button.

    2- Alternatively, I can only use the following url to logon:

    http://proquest.umi.com/pqdweb?RQT=301&UserId=myusername&Passwd=mypssword&JSEnabled=1

    where, the _myusername_ and _mypssword_ are the login credentials
    of mine.

    So, I want to konw the map rule from the first method to the the
    second, i.e., construct a url to do the same thing as a post form
    done.

    Regards,

    --
    ..: Hongyi Zhao [ hongyi.zhao AT gmail.com ] Free as in Freedom :.
     
    Hongyi Zhao, Feb 6, 2009
    #1
    1. Advertising

  2. Hongyi Zhao wrote:
    > Hi all,
    >
    > I want to construct a url to do the same thing that a post form done,
    > e.g., username and password, is the data submitted by the form. What
    > should I do then just a constructed url to do the same thing?
    >
    > Let me describe my issue in more detail:
    >
    > Take the following url as a example:
    >
    > http://proquest.umi.com/pqdweb
    >
    > My institute is a subscriber of it and I've a username and pssword of
    > this library. In my case, I find that I've two choices to log into
    > it:
    >
    > 1- Go to the above url, and then fill the logon form by my username
    > and pssword, finally, click on the connect button.
    >
    > 2- Alternatively, I can only use the following url to logon:
    >
    > http://proquest.umi.com/pqdweb?RQT=301&UserId=myusername&Passwd=mypssword&JSEnabled=1
    >
    > where, the _myusername_ and _mypssword_ are the login credentials
    > of mine.
    >
    > So, I want to konw the map rule from the first method to the the
    > second, i.e., construct a url to do the same thing as a post form
    > done.


    IF the application that processes the submitted form doesn't distinguish
    between data sent in a POST request and and data included in the URL in
    a GET request, you can use a query string of the form
    field1Name=field1Value&field2Name=field2Value& ...
    &fieldnName=fieldnValue for the names and values of each of the n fields
    in the form. But if the application is set up to process only posted
    data, then there *is* no way to create a URL that will automatically
    work in a GET request.
     
    Harlan Messinger, Feb 6, 2009
    #2
    1. Advertising

  3. Gazing into my crystal ball I observed Hongyi Zhao
    <> writing in
    news::

    > Hi all,
    >
    > I want to construct a url to do the same thing that a post form done,
    > e.g., username and password, is the data submitted by the form. What
    > should I do then just a constructed url to do the same thing?
    >
    > Let me describe my issue in more detail:
    >
    > Take the following url as a example:
    >
    > http://proquest.umi.com/pqdweb
    >
    > My institute is a subscriber of it and I've a username and pssword of
    > this library. In my case, I find that I've two choices to log into
    > it:
    >
    > 1- Go to the above url, and then fill the logon form by my username
    > and pssword, finally, click on the connect button.
    >
    > 2- Alternatively, I can only use the following url to logon:
    >
    > http://proquest.umi.com/pqdweb?RQT=301

    &UserId=myusername&Passwd=mypsswo
    > rd&JSEnabled=1


    3. Use Opera's wand feature which will store your login creditials, and
    just hit the wand or Ctrl-Enter. Or use Firefox which will do the same.

    >
    > where, the _myusername_ and _mypssword_ are the login credentials
    > of mine.
    >
    > So, I want to konw the map rule from the first method to the the
    > second, i.e., construct a url to do the same thing as a post form
    > done.
    >
    > Regards,
    >


    Both the post form data and querystring data consist of the same thing:
    name/value pairs. If you were to loop through:

    userId = myusername
    Passwd = mypssword
    JSEnabled = 1

    The third value probably tells the server that you have javascript
    enabled.

    When you fill out a form, it sends the names of the fields with the
    values to the server in a POST request. When the server receives a
    querystring, the server receives a GET request.

    The important thing here is what is done server side. The server must
    know if it is looking for a post or get request, or sometimes both, and
    then what to do with the data once it gets it. Usually, the information
    is going to a database, where either values are verified or input.

    This is also where it gets a little hairy. There is something called
    SQL injection, where someone can use a malformed request (post, get or
    cookies) to gain access to the database and create havoc - like
    ';DROP Table Members;

    Please Google for SQL Injection and learn how to protect yourself.


    --
    Adrienne Boswell at Home
    Arbpen Web Site Design Services
    http://www.cavalcade-of-coding.info
    Please respond to the group so others can share
     
    Adrienne Boswell, Feb 6, 2009
    #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. jasontoolittle

    Post Form Data to External URL

    jasontoolittle, Sep 28, 2010, in forum: Java
    Replies:
    0
    Views:
    838
    jasontoolittle
    Sep 28, 2010
  2. jasontoolittle

    Post Form Data to External URL

    jasontoolittle, Sep 28, 2010, in forum: .NET
    Replies:
    0
    Views:
    1,307
    jasontoolittle
    Sep 28, 2010
  3. Rudi Ahlers
    Replies:
    11
    Views:
    817
    Aaron Bertrand [MVP]
    Apr 11, 2004
  4. J. Muenchbourg
    Replies:
    0
    Views:
    366
    J. Muenchbourg
    Aug 6, 2003
  5. pavi
    Replies:
    0
    Views:
    1,344
Loading...

Share This Page