html proxy form converts a GET to a POST for processing with PHP

Discussion in 'Javascript' started by JRough, Mar 31, 2009.

  1. JRough

    JRough Guest

    I have a desktop database application that can send an address string
    from an embedded web applet. The only output I can get from this
    database is an HTTP GET with the address list. I need to capture this
    address list from the GET url then POST the address string to a php
    page.
    I call this proxy page clientsideform.html. It is a local html page
    on the hard drive. This is on a mac. There are reasons why I'm doing
    it this way.

    In any case, I'm not doing the GET right to get the value that comes
    after my web server, the get string addr=" "
    ----------------------------- clientSidePost.html--------------
    <html><head>
    <title>HTTP Proxy</title>
    <body onload="document.pgform.submit()">
    var addressList = GET "file://clientSidePost.html&addr= HTTP/1.0
    document.write(addressList);
    <form name = "pgform_post" method="post" action="http://localhost/
    Soliant/googlemap.php"
    <TEXTAREA NAME= addr>
    </TEXTAREA>
    <INPUT TYPE=SUBMIT VALUE="Show Map"
    /form>
    </head>
    </script>
    </body>
    </html>
    ------------------------------
    <html><head>
    <title>HTTP Proxy</title>
    <body onload="document.pgform.submit()">
    var addressList = GET "file://clientSidePost.html&addr= HTTP/1.0
    document.write(addressList);

    <form name = "pgform_post" method="post" action="http://localhost/
    Soliant/googlemap.php"
    <TEXTAREA NAME= addr>
    </TEXTAREA>
    </form>
    </head>
    </script>
    </body>
    </html>
    -------------

    This is the output I get:
    var addressList = GET "file://clientSidePost.html&addr= HTTP/1.0
    document.write(addressList);

    I also get an empty field in the form. I want this form to be hidden
    and for the php page to be posted instead. I don't want the user to
    even see the proxy page in his web browser. I need to get rid of the
    blank field.

    How do you write out the value of the variable troubleshoot what is
    going on? I tried document.write to see the value of addressList but
    it didn't work.

    Tia,
    JRough, Mar 31, 2009
    #1
    1. Advertising

  2. JRough

    Jon Gómez Guest

    Re: html proxy form converts a GET to a POST for processing withPHP

    JRough wrote:
    [snip]
    > ----------------------------- clientSidePost.html--------------
    > <html><head>
    > <title>HTTP Proxy</title>
    > <body onload="document.pgform.submit()">
    > var addressList = GET "file://clientSidePost.html&addr= HTTP/1.0
    > document.write(addressList);
    > <form name = "pgform_post" method="post" action="http://localhost/
    > Soliant/googlemap.php"
    > <TEXTAREA NAME= addr>
    > </TEXTAREA>
    > <INPUT TYPE=SUBMIT VALUE="Show Map"
    > /form>
    > </head>
    > </script>
    > </body>
    > </html>

    [snip]

    Use a validator:

    http://validator.w3.org/

    Start by fixing all of those errors. The validator even offers
    suggestions on how to fix things. That should be a big help.

    Here's an example of me cutting and re-writing your first HTML document,
    even though I'm still learning how to write valid html:

    http://www.pcs.cnu.edu/~jgomez/help.html

    For example, if you are trying to use Javascript, you need to add an
    opening tag for it. You have your '</script>' but not anything like
    '<script type="text/javascript">'. Your Javascript itself also has
    errors, if it were to execute.

    That will give you an environment in which you can mess around with the
    Javascript, with it actually working rather than being, for example,
    rendered as text to the page.

    Jon.
    Jon Gómez, Mar 31, 2009
    #2
    1. Advertising

  3. JRough

    JRough Guest

    On Mar 30, 7:56 pm, Jon Gómez <> wrote:
    > JRough wrote:
    >
    > [snip]
    >
    > > ----------------------------- clientSidePost.html--------------
    > > <html><head>
    > > <title>HTTP Proxy</title>
    > > <body onload="document.pgform.submit()">
    > > var addressList = GET "file://clientSidePost.html&addr= HTTP/1.0
    > > document.write(addressList);
    > > <form name = "pgform_post" method="post" action="http://localhost/
    > > Soliant/googlemap.php"
    > > <TEXTAREA NAME= addr>
    > > </TEXTAREA>
    > > <INPUT TYPE=SUBMIT VALUE="Show Map"
    > > /form>
    > > </head>
    > > </script>
    > > </body>
    > > </html>

    >
    > [snip]
    >
    > Use a validator:
    >
    >  http://validator.w3.org/
    >
    > Start by fixing all of those errors.  The validator even offers
    > suggestions on how to fix things.  That should be a big help.
    >
    > Here's an example of me cutting and re-writing your first HTML document,
    > even though I'm still learning how to write valid html:
    >
    >  http://www.pcs.cnu.edu/~jgomez/help.html
    >
    > For example, if you are trying to use Javascript, you need to add an
    > opening tag for it.  You have your '</script>' but not anything like
    > '<script type="text/javascript">'.  Your Javascript itself also has
    > errors, if it were to execute.
    >
    > That will give you an environment in which you can mess around with the
    > Javascript, with it actually working rather than being, for example,
    > rendered as text to the page.
    >
    > Jon.


    thanks, I will try the XML_HTTP request and thanks for the validator.
    p.s. I didn't put in the begin javascript tag because I didn't know
    if it went before the form tag.
    JRough, Mar 31, 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. Hubert Hung-Hsien Chang
    Replies:
    2
    Views:
    410
    Michael Foord
    Sep 17, 2004
  2. Replies:
    1
    Views:
    413
    Pavel Lepin
    Jul 30, 2007
  3. Rajive Narain
    Replies:
    0
    Views:
    1,577
    Rajive Narain
    Sep 18, 2009
  4. Beat Richli

    ASP converts Unicode Chars to HTML entities?

    Beat Richli, Sep 5, 2005, in forum: ASP General
    Replies:
    2
    Views:
    515
    Beat Richli
    Sep 7, 2005
  5. JRough
    Replies:
    11
    Views:
    255
    Evertjan.
    Oct 31, 2009
Loading...

Share This Page