f



convert a GET to a POST before output to php

I have a Filemaker desktop application that sends a string of
serialized addresses as a GET parameter to a google map
(googlemap.php).  There are some reasons I need to convert the GET to
a POST, one of which is there are sometimes 200 separate addresses and
in IE there is a limit.  So I designed this local HTML page as a proxy
of sorts to convert the GET to a POST before sending it to the
googelmap.php page to display as addresses on google map.     I copied
a Javascript routine from the web that parses the addresses and
assigns it to a variable (pgformproxy.js) .  I'm not getting some
output so can someone tell me how to debug this before posting it to
php or if I'm going in the right direction?  I don't know if I called
the function right or if the page post is right.  Thanks very much,
Janis


 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
 "http://www.w3.org/TR/html4/loose.dtd">
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitonal.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
	<head>
    <title>HTTP Proxy Convert Get to Post</title>
	<script type="text/javascript" src="pgformproxy.js"></script>
	</head>

<body onload='addrList=document.getURLParam(addr)'>
pgpost_url = file://localhost/Users/jlrough/Sites/workspace/soliant/googlemap.php">


<form name = "pgform_post" method="post" action=pgpost_url>
	<TEXTAREA NAME=Address rows="10" cols="10">
		value = addrList
	</TEXTAREA>
<input
type="hidden"
name = "PagePost"
value ="">
</form>

</body>
</html>

--------pgformproxy.js-------
function getURLParam(strParamName){
  var strReturn = "";
  var strHref = window.location.href;
  if ( strHref.indexOf("?") > -1 ){
    var strQueryString = strHref.substr(strHref.indexOf
("?")).toLowerCase();
    var aQueryString = strQueryString.split("&");
    for ( var iParam = 0; iParam < aQueryString.length; iParam++ ){
      if (
aQueryString[iParam].indexOf(strParamName.toLowerCase() + "=") > -1 ){
        var aParam = aQueryString[iParam].split("=");
        strReturn = aParam[1];
        break;
      }
    }
  }
  return unescape(strReturn);
}
0
jlrough (485)
7/20/2009 5:57:01 PM
comp.lang.javascript 38370 articles. 2 followers. javascript4 (1315) is leader. Post Follow

1 Replies
358 Views

Similar Articles

[PageSpeed] 30

JRough wrote:
> I have a Filemaker desktop application that sends a string of
> serialized addresses as a GET parameter to a google map
> (googlemap.php).  There are some reasons I need to convert the GET to
> a POST, one of which is there are sometimes 200 separate addresses and
> in IE there is a limit.  So I designed this local HTML page as a proxy
> of sorts to convert the GET to a POST before sending it to the
> googelmap.php page to display as addresses on google map.     I copied
> a Javascript routine from the web that parses the addresses and
> assigns it to a variable (pgformproxy.js) .  I'm not getting some
> output [...]

This might be related to your "HTML" not being Valid.

<http://validator.w3.org/>


PointedEars
-- 
Prototype.js was written by people who don't know javascript for people
who don't know javascript. People who don't know javascript are not
the best source of advice on designing systems that use javascript.
  -- Richard Cornford, cljs, <f806at$ail$1$8300dec7@news.demon.co.uk>
0
Thomas
7/21/2009 12:12:51 PM
Reply:

Similar Artilces:

html proxy form converts a GET to a POST for processing with PHP
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...

getting javascript-generated input element values with POST (php)
I'm having some problems.. I have some javascript generated input elements with dynamic names and values. ex: <input name = "t1Name" .../> <input name = "t2Name" .../> ..... <input name = "tnName".../> On submission, i'm trying to get the values in a php script using $_POST and I can't get any values out of them.. always getting null. Is it even possible to get javascript-generated input values using php? Thanks, Ben Ben Brown wrote: > I'm having some problems.. I have some javascript generated input > elements with dy...

Getting a file via http or evaluating a php file and getting its output
I need to somehow merge two separate web programs written in php together (from the user's perspective). This solution won't be perminant, I just need something done quickly. I was thinking of two different approches. One would be to download a processed version (modified so it will create validating html with the page it's being embeded in) of one of the programs with the other, then just use print to embed it in the page. I couldn't find out how to get a file via http here (http://us2.php.net/manual/en/index.php). Sorry if I missed this in the docs. The other would be t...

PHP Post/Get problem
Hi all, I have been working on a simple form to collect user data. The form is written in ASP. The target action is a PHP script on a completely different system. The problem I have been experiencing is when I use the GET method on the ASP form, my PHP page displays the data as collected. When I use the POST method (preferred), very same PHP page does not display the collected information. I have searched for anything that may give me a clue on php.net but found nothing. Please help. Thanks --K blcklabl@bellsouth.net wrote: > Hi all, > I have been working on a simple form to c...

getting data from javascript into php?
Hello I have the following Javascript code to gather the data to be sent to a php file for adding the data to mysql. for (i=startValue;i<(endValue+1);i++) { if (c1[i] != 'null') { // i.e. if c1[i] is used queryString += "&c1" + i + "_a=" + encodeURIComponent(c1[i]) + "&c1" + i + "_o=" + encodeURIComponent(oc1[i]) + "&c1" + i + "_d=" + encodeURIComponent(tdc1[i]) + "+"; } } The value of i can be from 1 to 120 but it could be that only c1[i] values for i = 111-120 and i = 1-10 ...

Javascript to HTML or PHP or Perl converter
I need to access web sites using my scripts written in Perl. I use lynx and elinks to access web pages. It works fine, unless the pages has some Javascript code. Most Javascript stuff is working under lynx and elinks, but some doesn't. Is there any converter from javascript to HTML or PHP or PERL? Is there any ASCII web browser that fully supports Javascript. Thanks oleg_orel@yahoo.com wrote: > I need to access web sites using my scripts written in Perl. I use lynx > and elinks to access web pages. It works fine, unless the pages has > some Javascript code. Most Javascript s...

get CGI output in javascript code
I have a CGI named CGItry.exe (written by c and compiled) which output string "CGIoutString". I want a JavaScript code to get this string value and assign it to a variable x, but the statement x=CGItry.exe don't work. I have few experience in the JavaScript/CGI world. Anyone could tell me how to do it? Thanks. Gene ...

PHP HTTPS POST Como hacer un POST https con PHP
http://wedoit4you.com/forums4you/display_message.php?Msg_pk_id=628 /** Author: Ing. Angel Leon Function: postHttps($url,$params) Given the full URL of the Target and The Params it will POST the params even if passing an HTTPS URL. Returns whatever the URL returns. */ function postHttps($url,$params) { $ch = curl_init ($url); curl_setopt ($ch, CURLOPT_HEADER, 0); curl_setopt ($ch, CURLOPT_POSTFIELDS, $params...

HTML POST and GET from within JavaScript
I am using the following function to call a PHP script which then returns its result to the callback javascript function "loadJSON". This, which is really the HTML GET Method, works fine except when the points variable is large and then obviously it doesn't work. function getElevationIntermediate(points) { var script = document.createElement('script'); document.body.appendChild(script); script.src = 'http://' + geoSpokeAddressTest + '?spoke=' + points + '&callback=loadJSON'; } Therefore I would like to use the HTML POST method instead but I cannot find out how to do this from within JavaScript. I have tried many ideas including the following but the PHP script receives the variables but doesn't use the callback. HTML <form id="postit" style="display:none" method="post" action=""> <input id="spoke"> <input id="callback"> <input type="submit"> </form> JavaScript var phpScript = "http://mysite/postex.php", callback = "loadJSON"; document.getElementById('postit').action = phpScript; document.getElementById('spoke').value = points; document.getElementById('callback').value = callback; document.getElementById('postit').submit(); PHP $latlngs = $_POST["spoke"]; $callback = $_POST["callback"]; ...

can javascript post a link to a php file?
In the script for the html5 audio player I am using, there is a bit of code that changes the active "<li>" class to "playing". It is at this point in time I need to send a bit of information to a php file to update the database with. What could I use to do this with? <script> $(function() { // Setup the player to autoplay the next track var a = audiojs.createAll({ trackEnded: function() { var next = $('ol li.playing').next(); if (!next.length) next = $('ol li').first(); ...

post or get message posting
Hi I have a form I need to post to with perl.The form is too big, but here is the key. It has no "type', as it's a message box input. How can I post to it? Thanks. <textarea class="ygta post-input-border" rows="10" cols="60" id="message"name="message" tabindex="3"></textarea> </label> </p> <br/> </td> </tr> <tr> RocketMan <rm@dontspamme.net> wrote: > I have a form I need to post to with perl...

PHP Post, then HTML Post?
Can anyone do this? Using PHP, I want to POST or GET some variables to a second php page. This, I already know how to do. However, on the second php page, I want to use a simple, standard HTML form using the standard form-submitting method such as: <form action="https://orderpage.ic3.com/hop/orderform.jsp" method="post"> whereupon both sets of variables --- the earlier variables that were POSTed or GETted to the second page, along with the standard form variables derived within the second page --- will be POSTed to the above URL. In the second page, might I actua...

My post dont get posted ?
Why dont my post get posted here ? - P Well I read it;-) I get the impression that the new Newsgroup interface still has 1 or 2 bugs. There has been at least one or two of my posts that I didn't get on this news reader, but were visible on other readers (along with the endless adverts to trainers etc.) so I guess it can't be all that bad. Regards Dave Robinson "Dave Robinson" <dave.robinson@somewhere.biz> wrote in message news:f7n7i0$ohc$1@fred.mathworks.com... > Well I read it;-) > > I get the impression that the new Newsgroup interface still has 1 or ...

remotely including php script output via javascript
I've got a simple php script that dumps some database info out that I would like to make available to others for inclusion on their web pages. Problem is some of them dont have access to PHP or CGI. Would this be possible with javascript? Tony Rice wrote: > I've got a simple php script that dumps some database info out that I would > like to make available to others for inclusion on their web pages. > Problem is some of them dont have access to PHP or CGI. > > Would this be possible with javascript? <script type="text/javascript" src="URLTo...

need client side form converts get to a post
By way of explanation, I get a serialized address list output from a database sent to my local html-javascript client. This is the string: file:///Tiger_HD/Library/WebServer/Documents/clientsidepost.html?q=3Da:4:{i= :0;s:49:%2244502%20Loneoak%2C%20Lancaster%2C%20CA%2C%2093534%22;i:1;s:50:%2= 23537%203rd%20St%2C%20Ridgefield%2C%20WA%2C%2098642%22;i:2;s:58:%22931%20Al= abama%20St%2C%20san%20francisco%2C%20CA%2C%2094110%22;i:3;s:0:%22%22;} I want the local html-javascript client form to convert it to a post and send it to my php server page. The location.search should get the one parameter, the q=3Dxxxxxx and put it in the first array index which I named q then it should post the q value so I now have a post I can use to plot address points on google maps. I get a response from the php page but it is not a getting a value for 'q'. I can put the results when I click submit if you want below or even show you my php page which works with a get but I need a post because of url length restrictions. Any help is appreciated, <html> <!DOCTYPE html> <html> <head> <meta http-equiv=3D"Content-Type" content=3D"text/html; charset=3Diso-8859-1"> <title>Demo</title> <script type =3D"text/javascript"> var gp=3Dnew Array(); var loc=3Dlocation.search; if (loc){ loc=3Dloc.substring(1); var parms=3Dloc.split('&amp;'); for(var i=3D0;i&lt;parms.length;i++){ nameValue...

convert Mersenne Twister Random number generator php to javascript
Can anyone convert this c++ / c source to javascript for me? Here is the source: https://github.com/php/php-src/blob/master/ext/standard/rand.c Especially, you can start from /* MT RAND FUNCTIONS */ In comp.lang.javascript message <a3c77748-a727-4b10-816d-bc8adc6201fd@go oglegroups.com>, Wed, 16 Jan 2013 09:25:10, Raitucarp <ribhararnus.pracu tiar@gmail.com> posted: >Can anyone convert this c++ / c source to javascript for me? > >Here is the source: >https://github.com/php/php-src/blob/master/ext/standard/rand.c > >Especially, you can start from /* MT RAND FUNCTIONS */ If you had read through the relevant section in the newsgroup FAQ, you would have seen the final (badly-described) link. It leads to my page demonstrating and testing various good random number generators which are already converted to JavaScript. -- (c) John Stockton, nr London UK Reply address via Home Page. news:comp.lang.javascript FAQ <http://www.jibbering.com/faq/index.html>. <http://www.merlyn.demon.co.uk/js-index.htm> jscr maths, dates, sources. <http://www.merlyn.demon.co.uk/> TP/BP/Delphi/jscr/&c, FAQ items, links. ...

Java class needs to get Cookie from PHP/Javascript URL page
URL: http://valsignalandet.com/cookiegrab.php?name=valIdentifier This page produces a cookie value and sends it back as HTML using PHP and Javascript to obtain it. This URL will be used as the value for a URLConnection object in a Java class to obtain the results of this page to get, of all things, a cookie value. Simply put: it's the ONLY way I know of where I can use Java to ultimately obtain a cookie since this is an application class (NOT a servlet) that has to obtain a cookie from your own machine and retrieve its value. The class itself works except that it obtains all of the HTM...

Dot in POST parameter name gets converted to "_"
I've noticed that a dot in a POST parameter name - i.e. <input name="person.first_name" type="text"> get converted to an underscore when populated into $_POST. Presumably this is a throwback to register_globals, as the programmer would not be able to access the variables unless the dots were stripped (since dots are concatenation in PHP). However, since register_globals is pretty much never used, I thought there might be a way to turn this off via php.ini. Prepending code to re-parse the postdata would solve the problem, but it seems lame to parse the p...

(method="post" || method="POST") && (method="get" || method="GET")
Let's not argue about semantics. Let's talk about semasiology. Do specifications exist for using mixed case, upper case, lower case for the contents of the method employed? My own preferences lean towards the all lower-case model, simply because it reads a little easier when deployed with other XHTML semaphorings. -- Jim Carlock Post replies to the group. Jim Carlock wrote: > Let's not argue about semantics. Let's talk about semasiology. > > Do specifications exist for using mixed case, upper case, > lower case for the contents of the metho...

Get Method Works but not Post Method on PHP 5.0.4 pages
I am unable to display PHP pages generated by a submission of a form using a POST method. To illustrate this, I created a very simple form called TestForm.php . <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <title>Test Form</title> </head> <body> <form action="<?php echo $_SERVER['...

how to get a javascript function value stored in a database using php---really imp. 487031
hi thanks a lot for answering my other queries fast my problem is ihad a javascript function in which many values are returned in one variable. now after it i want that the return values must be insert into the database by using php. can anyone tell me how can i sand a javascript function return value to a databse of mysql eg <script> function() { x = //(values) return(x) } </script> now x must be in databse,how DNT WORRY FROM PROBLEMS *** Sent via Developersdex http://www.developersdex.com *** garima puri wrote: > hi > thanks a lot for answering my other queries fast &g...

FAQ Topic
----------------------------------------------------------------------- FAQ Topic - How do I get a jsp/php variable into client-side javascript? ----------------------------------------------------------------------- Use a server-side language to generate the javascript. Certain characters of ECMAScript strings must be escaped by backslash. These include quote marks, backslash, and line terminators. JSP Example, using Apache Commons: `org.apache.commons.lang.StringEscapeUtils`: var jsVar = "<%= StringEscapeUtils.escapeJavaScript(str) %>"; PHP example using `addcslashes`: var jsVar = "<?php echo addcslashes($str,"\\\'\"\n\r"); ?>"; <URL: http://jibbering.com/faq/example/addcslashes.php> <URL: http://php.net/manual/en/function.addcslashes.php> <URL: http://commons.apache.org/lang/> The complete comp.lang.javascript FAQ is at http://jibbering.com/faq/ -- The sendings of these daily posts are proficiently hosted by http://www.pair.com. ...

FAQ Topic
----------------------------------------------------------------------- FAQ Topic - How do I get a jsp/php variable into client-side javascript? ----------------------------------------------------------------------- Use the server-side language to generate the javascript: // JSP var jsvar = "${ jspVar }"; // PHP var jsvar = "<?php echo $phpVar ?>"; If an inline-script tag is used, the string must not contain any markup-significant characters such as ` < `, ` > `, ` & `, ` ' ` or ` " `. Such characters must be converted HTML entities on the server. http://www.w3.org/TR/html4/sgml/entities.html The complete comp.lang.javascript FAQ is at http://jibbering.com/faq/ -- The sendings of these daily posts are proficiently hosted by http://www.pair.com. FAQ server wrote: > ----------------------------------------------------------------------- > FAQ Topic - How do I get a jsp/php variable into > client-side javascript? > ----------------------------------------------------------------------- Why jsp/php? This doesn't apply to ASP, Python, etc.? > > Use the server-side language to generate the javascript: That's an awkward way to put it. You can't use anything else but a language when programming. Is this supposed to be as opposed to the server-side tractor? > > // JSP > var jsvar = "${ jspVar }"; > // PHP > var jsvar...

plz help me how to convert php(or)html to pdf i didnt get correct solution help me please....
Hi i used fpdf class for html to pdf converter. I generated pdf but it shows without style sheet implementation and gif images are not show in generated PDF how to solve gif imge error and style sheet not applicable error... Please help me... Thank u... with regards, S.Rajkumar.. On Aug 9, 7:33=A0am, Raj Kumar <rajkumar.sa...@gmail.com> wrote: > I generated pdf =A0but it shows without style sheet implementation and > gif images are not show in generated PDF PDF an HTML are two totally different things. You can't use the CSS style sheet in PDF. With FPDF, you have to place the images at the right place yourself. Or maybe you are talking about this: http://html2fpdf.sourceforge.net/ ...

Web resources about - convert a GET to a POST before output to php - comp.lang.javascript

List of converts to Buddhism - Wikipedia, the free encyclopedia
Ajahn Brahm (born 1951), Religious teacher and student of the late Thai monk Ajahn Chah . Currently he is the abbot of the Bodhinyana Monastery, ...

Facebook Timeline For Pages: 8 Million Converts, 29 Million To Go
... reach to 98 percent of users who liked its page, as well as to double its engagement rate, during a 28-day period. Dr. Pepper hasn’t yet converted ...

Facebook stock roundup: Execs offload more stock, directors convert shares
... Bowles, the former co-chair of the now-defunct National Commission on Fiscal Responsibility and Reform, and Reed Hastings, Netflix CEO, converted ...

How to Convert Leads Into Buying Customers - The 9 Step Sales Process EVERYONE Should Use
... School of Business in Toronto on the topics of Sales and Entrepreneurship. I shared with them the sales process that I find How to Convert Leads ...

Bitcoin : Should I convert my savings to Bitcoin?
Answer (1 of 7): You should think of this question as "Should I invest all my savings in Bitcoin?", and not "Should I have my savings denominated ...

Coordinates - Calculate and Convert a Position on the App Store on iTunes
Get Coordinates - Calculate and Convert a Position on the App Store. See screenshots and ratings, and read customer reviews.

Coca-Cola made packaging that converts into a free Google Cardboard-style VR viewer [Video]
... if the above experiment turns into reality. The project envisions packaging for a 12-pack of Cokes and other products that is easily converted ...

Coca-Cola made packaging that converts into a free Google Cardboard-style VR viewer for iPhone
... if the above experiment turns into reality. The project envisions packaging for a 12-pack of Cokes and other products that is easily converted ...

The Galaxy S7 Edge may have just made me a Samsung convert
Historically, I've had a begrudging respect for Samsung flagships. I can objectively acknowledge the company makes very good, extremely popular ...

This modular robot tank converts into a tracked hoverboard
Filed under: Etc. , Videos , Autonomous , Military , Off-Road The unmanned vehicle is equal parts hoverboard and tank.

Resources last updated: 3/12/2016 5:01:31 AM