Re: HTTP POST from PHP using a link



On Mon, 14 Jan 2008 22:57:26 +0100, <trpost@xxxxxxxxx> wrote:

I am looking for a way to send data from one page to another as POST
data without using forms or cURL.

I have a php script that is passing a list of cases from on page to
another when a link is clicked. This is working fine for the most part
as a link, but sometimes the list gets very large and gets cut off.
The reason it gets cut off appears to be a limitation on the amount of
data that can be passesd in the URI.

It looks like I can do this with cURL, but this script will run on
several servers that do not have cURL compiled in and I do not want to
recompile now.

I found a few posts that say this can be done with PHP and javascript,
but I found no good examples.

To give you an example on what I am doing:
<a href=case_details.php?cases=".$allCases."&priority=Low&PG=All>
$count</a>

$allCases is a comma separated list of numbers and can get very large.
i.e. 84638,48957,58945,45375,....

While you could 'cheat' by firing a XMLHTTPRequest which actually posts with javascript, this would not be very reliable, and for about 5%-15% of the people just plain won't work.

As stated numerous times the last few weeks: you probably want to save the data in a session. No posting/getting necessary, you allready have the data ready on your server.

However: can you tell why it is your link couldn't be a button that posts a form? Never make it harder on yourself then should be...
--
Rik Wasmus
.



Relevant Pages

  • HTTP POST from PHP using a link
    ... I have a php script that is passing a list of cases from on page to ... It looks like I can do this with cURL, but this script will run on ... recompile now. ... I found a few posts that say this can be done with PHP and javascript, ...
    (comp.lang.php)
  • Re: php, cURL and javascript
    ... someone will tell me how to use the curl php functions to navigate ... only roadblock for me when using curl alone. ... You might be able to get by the javascript on this page just by ... to use the php curl functions to login to the site, ...
    (comp.lang.php)
  • Re: php, cURL and javascript
    ... only roadblock for me when using curl alone. ... You might be able to get by the javascript on this page just by ... to use the php curl functions to login to the site, ...
    (comp.lang.php)
  • Re: parsing website with a "searching...." page
    ... Aaron wrote: ... The page is probably using JavaScript to give that effect. ... Erwin is correct. ... This one is going to be very tough to scrape - you'll need to decode what the javascript does and emulate it with Curl to get the page. ...
    (comp.lang.php)
  • Re: curl twice
    ... I'm using curl to invoke a php script on the same site/server. ...
    (comp.lang.php)