Sending POST-data

This is a discussion on Sending POST-data within the PHP General forums, part of the PHP Programming Forums category; I'm making a search-engine script for my site that redirects users to other search engines. Point is that ...


Go Back   Usenet Forums > PHP Programming Forums > PHP General

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 07-25-2003
Simon Fredriksson
 
Posts: n/a
Default Sending POST-data


I'm making a search-engine script for my site that redirects users to
other search engines. Point is that on the website, there's a drop-down
box with some engines and one textfield.

1. User enter the search query.
2. User selects which engine to use.
3. User submits.
4. PHP scripts checks which engine and redirects the user and the query
to the selected engine.

Now the thing is that some of these engines use POST method, which makes
it a bit harder to redirect the query. For those who use GET I just have
to use something like Header("Location: http://somewnine.com/query=$query");

So, does anyone have any good solution to this problem?

//Simon

Reply With Quote
  #2 (permalink)  
Old 07-25-2003
Chris Shiflett
 
Posts: n/a
Default Re: [PHP] Sending POST-data

--- Simon Fredriksson <simon@lan2k.org> wrote:
> Now the thing is that some of these engines use POST method,
> which makes it a bit harder to redirect the query. For those
> who use GET I just have to use something like
> header("Location: http://somewnine.com/query=$query");
>
> So, does anyone have any good solution to this problem?


You have to either let the user POST (rather than redirecting from your site to
the target) or send the POST request yourself and display the result to the
user.

If you choose the latter, search the archives for sample code to send POST
requests from PHP.

Chris

=====
Become a better Web developer with the HTTP Developer's Handbook
http://httphandbook.org/
Reply With Quote
  #3 (permalink)  
Old 07-25-2003
Marek Kilimajer
 
Posts: n/a
Default Re: [PHP] Sending POST-data

Output the required form with hidden fields from your script and use
onload="document.forms[0].submit();"

Simon Fredriksson wrote:

>
> I'm making a search-engine script for my site that redirects users to
> other search engines. Point is that on the website, there's a drop-down
> box with some engines and one textfield.
>
> 1. User enter the search query.
> 2. User selects which engine to use.
> 3. User submits.
> 4. PHP scripts checks which engine and redirects the user and the query
> to the selected engine.
>
> Now the thing is that some of these engines use POST method, which makes
> it a bit harder to redirect the query. For those who use GET I just have
> to use something like Header("Location:
> http://somewnine.com/query=$query");
>
> So, does anyone have any good solution to this problem?
>
> //Simon
>
>


Reply With Quote
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 01:29 AM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0