473,659 Members | 3,117 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

HTTP POST from PHP using a link

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_detai ls.php?cases=". $allCases."&pri ority=Low&PG=Al l>
$count</a>

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

Thanks!
Jan 14 '08 #1
13 5102
On Mon, 14 Jan 2008 22:57:26 +0100, <tr****@gmail.c omwrote:
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_detai ls.php?cases=". $allCases."&pri ority=Low&PG=Al l>
$count</a>

$allCases is a comma separated list of numbers and can get very large.
i.e. 84638,48957,589 45,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
Jan 14 '08 #2
tr****@gmail.co m 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_detai ls.php?cases=". $allCases."&pri ority=Low&PG=Al l>
$count</a>

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

Thanks!
If you do it with php and javacript you are in effect using a form, which
you have stated you do not want to do.
Jan 14 '08 #3
tr****@gmail.co m 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_detai ls.php?cases=". $allCases."&pri ority=Low&PG=Al l>
$count</a>

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

Thanks!
Your talking about cURL but also talking about doing it in links? Kinda
confused.

If the data is large, it should be in a database or stored in session.

If your just wanting to submit that data to another site then display
results, you can also use sockets and do a manual HTTP request with the
POST data.

The biggest question is why send so much data and not use a form?

--
Daniel Ennis
faNetworks.net - Quality Web Hosting and Ventrilo Services
System Administrator / Web Developer
PHP Developer for 6 years
da****@fanetwor ks.net
Jan 14 '08 #4
On Jan 14, 3:33*pm, "Paul Lautman" <paul.laut...@b tinternet.com>
wrote:
trp...@gmail.co m 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_detai ls.php?cases=". $allCases."&pri ority=Low&PG=Al l>
$count</a>
$allCases is a comma separated list of numbers and can get very large.
i.e. 84638,48957,589 45,45375,....
Thanks!

If you do it with php and javacript you are in effect using a form, which
you have stated you do not want to do.- Hide quoted text -

- Show quoted text -
Well I guess I don't mind using a form, but I have a few hundred links
on the page and didn't think it would be efficient to create a hidden
field for each potential link. I instead just want to send the data
that is clicked on. For example here is how you use the applciation:
Name Low Med. High
Test 100 980 203
Test1 433 656 135
Test2 118 313 733
Test3 952 416 518
Test4 205 813 465
Test5 425 556 324
Test6 113 131 943
Test7 291 767 304
....
This goes on for a few hundred rows.... You can currently click on any
number, which passes a list of underlying numbers to another .php
script which gives you more details. So if you click on 100, it goes
to another script passing a comma separated list of 100 cases.
Jan 14 '08 #5
Hello,

on 01/14/2008 07:57 PM tr****@gmail.co m said the following:
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_detai ls.php?cases=". $allCases."&pri ority=Low&PG=Al l>
$count</a>

$allCases is a comma separated list of numbers and can get very large.
i.e. 84638,48957,589 45,45375,....
You can try this HTTP client class. It can perform arbitrary HTTP
requests without using Curl:

http://www.phpclasses.org/httpclient
--

Regards,
Manuel Lemos

PHP professionals looking for PHP jobs
http://www.phpclasses.org/professionals/

PHP Classes - Free ready to use OOP components written in PHP
http://www.phpclasses.org/
Jan 14 '08 #6
On Jan 14, 3:55*pm, Manuel Lemos <mle...@acm.org wrote:
Hello,

on 01/14/2008 07:57 PM trp...@gmail.co m said the following:


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_detai ls.php?cases=". $allCases."&pri ority=Low&PG=Al l>
$count</a>
$allCases is a comma separated list of numbers and can get very large.
i.e. 84638,48957,589 45,45375,....

You can try this HTTP client class. It can perform arbitrary HTTP
requests without using Curl:

http://www.phpclasses.org/httpclient

--

Regards,
Manuel Lemos

PHP professionals looking for PHP jobshttp://www.phpclasses. org/professionals/

PHP Classes - Free ready to use OOP components written in PHPhttp://www.phpclasses. org/- Hide quoted text -

- Show quoted text -
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.
Jan 15 '08 #7
tr****@gmail.co m wrote:
On Jan 14, 3:55 pm, Manuel Lemos <mle...@acm.org wrote:
>Hello,

on 01/14/2008 07:57 PM trp...@gmail.co m said the following:


>>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_detai ls.php?cases=". $allCases."&pri ority=Low&PG=Al l>
$count</a>
$allCases is a comma separated list of numbers and can get very large.
i.e. 84638,48957,589 45,45375,....
You can try this HTTP client class. It can perform arbitrary HTTP
requests without using Curl:

http://www.phpclasses.org/httpclient

--

Regards,
Manuel Lemos

PHP professionals looking for PHP jobshttp://www.phpclasses. org/professionals/

PHP Classes - Free ready to use OOP components written in PHPhttp://www.phpclasses. org/- Hide quoted text -

- Show quoted text -

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.
Where did the data come from in the first place? A database maybe? If
so, just send the key back and query the database again.

Or have a separate form for each row.
--
=============== ===
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attgl obal.net
=============== ==
Jan 15 '08 #8
Hello,

on 01/14/2008 11:39 PM tr****@gmail.co m said the following:
>>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_detai ls.php?cases=". $allCases."&pri ority=Low&PG=Al l>
$count</a>
$allCases is a comma separated list of numbers and can get very large.
i.e. 84638,48957,589 45,45375,....
You can try this HTTP client class. It can perform arbitrary HTTP
requests without using Curl:

http://www.phpclasses.org/httpclient

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.

--

Regards,
Manuel Lemos

PHP professionals looking for PHP jobs
http://www.phpclasses.org/professionals/

PHP Classes - Free ready to use OOP components written in PHP
http://www.phpclasses.org/
Jan 15 '08 #9
tr****@gmail.co m wrote:
On Jan 14, 3:55 pm, Manuel Lemos <mle...@acm.org wrote:
>Hello,

on 01/14/2008 07:57 PM trp...@gmail.co m said the following:


>>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_detai ls.php?cases=". $allCases."&pri ority=Low&PG=Al l>
$count</a>
$allCases is a comma separated list of numbers and can get very large.
i.e. 84638,48957,589 45,45375,....
You can try this HTTP client class. It can perform arbitrary HTTP
requests without using Curl:

http://www.phpclasses.org/httpclient

--

Regards,
Manuel Lemos

PHP professionals looking for PHP jobshttp://www.phpclasses. org/professionals/

PHP Classes - Free ready to use OOP components written in PHPhttp://www.phpclasses. org/- Hide quoted text -

- Show quoted text -

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.
Then what your asking to do is totally client side and has nothing to do
with PHP. Try c.l.js.

If its not doable in JS, then you need to use a form. But honestly what
your doing is very weird, and unless this is going across different
domains, is NOT the proper solution for what your trying to do.

The only reason you should ever be doing what your trying to do is if
your sending data from like domaina.com to domainb.com where cookies and
sessions wont persist.

If your sending this from mysite.com/page1.php to mysite.com/page2.php,
seriously reconsider your design of this code and change it to be passed
by session, database key, something to retrieve the data on the next
page and not send it between POST or GET.

--
Daniel Ennis
faNetworks.net - Quality Web Hosting and Ventrilo Services
System Administrator / Web Developer
PHP Developer for 6 years
da****@fanetwor ks.net
Jan 15 '08 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
3984
by: sentinel | last post by:
Hi, Wonder if anyone can help with this problem: I am using an app with several pages, using a session to track vars between the pages, and using an image map to re-direct back and forwards between the pages. The way I redirect is when the image map is clicked on, it posts to a page called 'control.php' which passes the POST vars to the
1
4190
by: Michael Brennan-White | last post by:
If I submit my for using a get action the resulting page loads . If I use a post action I get an error page saying "The page cannot be found". I am calling the originating page!!! This happens in IE as well as FireFox. This code has been tested on a Win2003 server, IIS6, PHP 5.0.3, mySQL 4.1.8 and it works fine. The problem server is a Win2k server, IIS5, PHP 5.0.4, mySQL 4.1.11.
4
2177
by: Dodo | last post by:
Is it possible to create a link that can post a value to an ASP page without java?
1
2675
by: microsoft.public.dotnet.languages.vb | last post by:
Hi All, I have an asp page. There I enter some text. This text needs to go some other web site but as jsp page ( such as http://www.web.com/Link.jsp). Now, I was told to submit my asp page as HTTP Post to their jsp page. This is completely a new thing for me to do. I was following the sample given in http://www.aspfaq.com/show.asp?id=2173
3
2014
by: news.onet.pl | last post by:
Hello I'm biting into the following problem: HTTP is stateless protocol and thus net languages' designer had to find out session. As far as I know session handling in any of the language (PHP, JSP, ASP) is one of the of the following: - user's IP, but ambiguous - using cookies, sometimes disregarded due to possibility of turning off in a browser; no need to control flow of data, checking links - controlling every link, the uses can...
6
10430
by: Clif | last post by:
Hi, I would like to find out exactly what is being sent when a web page uses the post request method. My thought was to use the webbrowser control together with the HTTPWebRequest class, but am having trouble tying the two together. Any ideas? Thanks, Clif
7
1627
by: Andy Kendall | last post by:
Hi, This article states the following in relation to ASP.NET default test harness web pages. "These test pages can be used to invoke your WebMethods, but the test harness does this by making HTTP POST requests to the server rather than HTTP SOAP requests. SoapExtensions only work with SOAP requests, and thus any requests to your Web service made using the default test page will result in your extensions not being used."
0
7818
by: Wayne Deleersnyder | last post by:
Hi All, I'm hoping to try to solve this error. I'm currently putting together a little web app, but I need it to work under both IE6, IE7, Mozilla, etc... Although the formatting is off for some pages, I suspect that's due to issues with IE6. I'm hoping to use the app on the company network, and most of our computers have to stay at IE6 until the powers that be say we can upgrade to IE7. Anyways, here's the BIG error in my case. On...
3
1879
by: BVS | last post by:
Presently, my website which is written in c# uses this command to move around my site: Response.Redirect("products.aspx?pro="+thechosenproduct) Is there a way to switch this to a POST method so that the pro= doesn't appear in the address bar?
0
8428
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8335
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8851
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8747
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8627
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6179
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5649
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
1
2752
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
1976
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.