Re: HTTP POST from PHP using a link



Michael Fesser wrote:
.oO(Manuel Lemos)

on 01/14/2008 11:39 PM trpost@xxxxxxxxx said the following:
I tried the Class and it looks to be able to send POST data to a page
and request back the results. I am looking to actually goto the page
as if you had clicked on the link. I basically created an app that
sometimes tries to send data to a page that exceeds the max length
allowed in the URL. What are options for getting around that limit. I
could see using a form if I had just one link, but I have hundreds and
can't think of a way to just send the data from the link I click on if
I used a form.
I think the limit is in the browsers, something like 255 characters. So
I think you can submit a GET request using that class to an URL without
that limit.

There are also buffer limits in the web servers. For sending large
amounts of data to a script POST is the correct way.

Micha
You can do this with javascript.

Essentially use the onclick() stuff to poke the right data into a HIDDEN variable, and POST that to the form

So you have somewhere
<form method="post">
<INPUT type="hidden" name="postvariable1" id="p1" value="">

<div onclick="do_my_stuff("a very long string")";>Click here to go somewhere else
</div>
</form

and a javascript..
<script>
function do_my_stuff (p)
{
getElemntById[['p1']=p;
document.form[0].submit();
}
</script>

Syntax is guaranteed to be wrong, but thats the principle
.



Relevant Pages

  • Re: [PATCH 20/22] ide-tape: cleanup the remaining codestyle issues
    ... int count; ... * Postpone the current request so that ide.c will be able to service requests ... goto out; ... return ret; ...
    (Linux-Kernel)
  • Re: Are Postback and Round Trip to the Server the same thing?
    ... Everything on the world wide web uses request and response. ... In ASP.NET, by default, all elements are inside a tag, so every control you touch contacts the server using POST, which is why Microsoft calls it a PostBack. ... Using JavaScript, you can load all of this into an array on the client side and adjust the text in the dropdownlist based on user's model choice. ... AJAX, or Asynchronous JavaScript And XML is a blend of JavaScript and XmlHttp Postback capabilities. ...
    (microsoft.public.dotnet.framework.aspnet)
  • HTTPModule - an interceptor indeed, but without communication skills!
    ... if javascript is enabled on the browser + some other plugin checks via ... Id rather implement this check without touching any of the aspx files. ... By request parameters being passed via the url. ... at it through a browser with disabled javascript cause it would render the ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: AJAX with embedded server questions
    ... another request is sent. ... ISTM that JSON tends to require less overhead for less structured ... discussion on the topic of XML vs. JSON. ... Prototype.js was written by people who don't know javascript for people ...
    (comp.lang.javascript)
  • [PATCH 05/10] block: convert to pos and nr_sectors accessors
    ... request fields always equal the!hard fields. ... goto repeat; ... struct nbd_request request; ... memcpy(request.handle, &req, sizeof(req)); ...
    (Linux-Kernel)