473,404 Members | 2,187 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,404 software developers and data experts.

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_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,....

Thanks!
Jan 14 '08 #1
13 5080
On Mon, 14 Jan 2008 22:57:26 +0100, <tr****@gmail.comwrote:
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
Jan 14 '08 #2
tr****@gmail.com 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,....

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.com 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,....

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****@fanetworks.net
Jan 14 '08 #4
On Jan 14, 3:33*pm, "Paul Lautman" <paul.laut...@btinternet.com>
wrote:
trp...@gmail.com 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,....
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.com 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_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,....
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.orgwrote:
Hello,

on 01/14/2008 07:57 PM trp...@gmail.com 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_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,....

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.com wrote:
On Jan 14, 3:55 pm, Manuel Lemos <mle...@acm.orgwrote:
>Hello,

on 01/14/2008 07:57 PM trp...@gmail.com 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_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,....
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*******@attglobal.net
=================
Jan 15 '08 #8
Hello,

on 01/14/2008 11:39 PM tr****@gmail.com 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_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,....
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.com wrote:
On Jan 14, 3:55 pm, Manuel Lemos <mle...@acm.orgwrote:
>Hello,

on 01/14/2008 07:57 PM trp...@gmail.com 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_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,....
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****@fanetworks.net
Jan 15 '08 #10
..oO(Manuel Lemos)
>on 01/14/2008 11:39 PM tr****@gmail.com 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
Jan 15 '08 #11
Daniel Ennis wrote:
tr****@gmail.com wrote:
>On Jan 14, 3:55 pm, Manuel Lemos <mle...@acm.orgwrote:
>>Hello,

on 01/14/2008 07:57 PM trp...@gmail.com 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_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,....
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.
It's not good to save large amounts of data in the session - it can be
quite slow.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attglobal.net
==================

Jan 15 '08 #12
..oO(The Natural Philosopher)
>Michael Fesser wrote:
>>
There are also buffer limits in the web servers. For sending large
amounts of data to a script POST is the correct way.

You can do this with javascript.
Sure, if it doesn't have to be reliable ...

Micha
Jan 15 '08 #13
Michael Fesser wrote:
.oO(The Natural Philosopher)
>Michael Fesser wrote:
>>There are also buffer limits in the web servers. For sending large
amounts of data to a script POST is the correct way.
You can do this with javascript.

Sure, if it doesn't have to be reliable ...
Javascript is *pretty* reliable on *simple* things.

If the site doesn't work on I-phones, who cares ;-)

I don't WANT i-phone customers using my sites anyway. Spawn of the devil
etc.
Micha
Jan 15 '08 #14

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

Similar topics

3
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...
1
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...
4
by: Dodo | last post by:
Is it possible to create a link that can post a value to an ASP page without java?
1
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...
3
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,...
6
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...
7
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...
0
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...
3
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...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
0
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...
0
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,...
0
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...
0
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...

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.