Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Javascript > html proxy form converts a GET to a POST for processing with PHP

Reply
Thread Tools

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

 
 
JRough
Guest
Posts: n/a
 
      03-31-2009
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,
 
Reply With Quote
 
 
 
 
Jon Gómez
Guest
Posts: n/a
 
      03-31-2009
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.
 
Reply With Quote
 
 
 
 
JRough
Guest
Posts: n/a
 
      03-31-2009
On Mar 30, 7:56*pm, Jon Gómez <(E-Mail Removed)> 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.
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
need client side form converts get to a post JRough Javascript 11 10-31-2009 03:28 PM
PHP Training Institute In Delhi, Live Projects on PHP. Short TermPHP Courses, PHP Scripts, PHP Training with Live Projects. Rajive Narain Java 0 09-18-2009 10:47 AM
ASP converts Unicode Chars to HTML entities? Beat Richli ASP General 2 09-07-2005 05:25 PM
Post-Processing RAW vs Post-Processing TIFF Mike Henley Digital Photography 42 01-30-2005 08:26 AM
Question: processing HTML, re-write default processing action of many tags Hubert Hung-Hsien Chang Python 2 09-17-2004 03:10 PM



Advertisments