Bluehost.com Web Hosting $6.95

Sending a POST variable to an ASP page

This is a discussion on Sending a POST variable to an ASP page within the PHP General forums, part of the PHP Programming Forums category; Hi, I need to send a post variable to an ASP page, can I do this within my PHP script? ...


Go Back   Usenet Forums > PHP Programming Forums > PHP General

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 08-27-2008
shaun thornburgh
 
Posts: n/a
Default Sending a POST variable to an ASP page

Hi,

I need to send a post variable to an ASP page, can I do this within my PHP script?

I don't need to view the page, or get any acknowledgment back, just send the single POST variable...

Thanks for your advice
__________________________________________________ _______________
Get Hotmail on your mobile from Vodafone
http://clk.atdmt.com/UKM/go/107571435/direct/01/
Reply With Quote
  #2 (permalink)  
Old 08-27-2008
tedd
 
Posts: n/a
Default Re: [PHP] Sending a POST variable to an ASP page

At 5:54 PM +0000 8/27/08, shaun thornburgh wrote:
>Hi,
>
>I need to send a post variable to an ASP page, can I do this within
>my PHP script?
>
>I don't need to view the page, or get any acknowledgment back, just
>send the single POST variable...


The point is not IF php can send a POST (it can), but rather can ASP
receive a POST?

Cheers,

tedd

--
-------
http://sperling.com http://ancientstones.com http://earthstones.com
Reply With Quote
  #3 (permalink)  
Old 08-27-2008
mrclay
 
Posts: n/a
Default Re: Sending a POST variable to an ASP page

On Aug 27, 1:54*pm, shaunthornbu...@hotmail.com (shaun thornburgh)
wrote:
> I need to send a post variable to an ASP page, can I do this within my PHP script?


Yes, via the cuRL extension or (arguably easier) via a custom stream
context:
http://netevil.org/blog/2006/nov/htt...p-without-curl

Steve
Reply With Quote
  #4 (permalink)  
Old 08-27-2008
shaun thornburgh
 
Posts: n/a
Default RE: [PHP] Sending a POST variable to an ASP page





> Date: Wed, 27 Aug 2008 14:13:23 -0400> To: php-general@lists.php.net> From: tedd.sperling@gmail.com> Subject: Re: [php] Sending a POST variable toan ASP page> > At 5:54 PM +0000 8/27/08, shaun thornburgh wrote:> >Hi,> >> >I need to send a post variable to an ASP page, can I do this within> >my PHP script?> >> >I don't need to view the page, or get any acknowledgment back, just > >send the single POST variable...> > The point is not IF php can send a POST (it can), but rather can ASP > receive a POST?>


Hi Tedd, The ASP script has been set up to receive POST variables from a form.> Cheers,> > tedd> > -- > -------> http://sperling.com http://ancientstones.com http://earthstones.com> > -- > PHP General Mailing List (http://www.php.net/)> To unsubscribe, visit: http://www.php.net/unsub.php>
__________________________________________________ _______________
Win New York holidays with Kellogg’s & Live Search
http://clk.atdmt.com/UKM/go/107571440/direct/01/
Reply With Quote
  #5 (permalink)  
Old 08-27-2008
Nathan Nobbe
 
Posts: n/a
Default Re: [PHP] Sending a POST variable to an ASP page

On Wed, Aug 27, 2008 at 12:13 PM, tedd <tedd.sperling@gmail.com> wrote:

> At 5:54 PM +0000 8/27/08, shaun thornburgh wrote:
>
>> Hi,
>>
>> I need to send a post variable to an ASP page, can I do this within my PHP
>> script?
>>
>> I don't need to view the page, or get any acknowledgment back, just send
>> the single POST variable...

>
>

use the curl or http extension.


The point is not IF php can send a POST (it can), but rather can ASP receive
> a POST?



if this were the case i doubt asp would have ever been used at all ;)

-nathan

Reply With Quote
  #6 (permalink)  
Old 08-27-2008
Shawn McKenzie
 
Posts: n/a
Default Re: Sending a POST variable to an ASP page

shaun thornburgh wrote:
> Hi,
>
> I need to send a post variable to an ASP page, can I do this within my PHP script?
>
> I don't need to view the page, or get any acknowledgment back, just send the single POST variable...
>
> Thanks for your advice
> __________________________________________________ _______________
> Get Hotmail on your mobile from Vodafone
> http://clk.atdmt.com/UKM/go/107571435/direct/01/


If you don't mind building the headers yourself in the code, it's just a
matter of using fsockopen() and then fputs().

-Shawn
Reply With Quote
  #7 (permalink)  
Old 08-27-2008
Nathan Nobbe
 
Posts: n/a
Default Re: [PHP] Sending a POST variable to an ASP page

heres a simple example shaun,

$cH = curl_init('url to asp box');
curl_setopt_array(
$cH,
array(
CURLOPT_POST => TRUE,
* CURLOPT_POSTFIELDS* => array(
'yourParamName' => 'yourParamVal'
)
));
$response = curl_exec($cH);

personally though, i prefer the http extension and its much cleaner api.

-nathan

Reply With Quote
  #8 (permalink)  
Old 08-27-2008
shaun thornburgh
 
Posts: n/a
Default RE: [PHP] Re: Sending a POST variable to an ASP page





> To: php-general@lists.php.net> Date: Wed, 27 Aug 2008 14:07:31 -0500> From: nospam@mckenzies.net> Subject: [php] Re: Sending a POST variable to anASP page> > shaun thornburgh wrote:> > Hi,> > > > I need to send a post variable to an ASP page, can I do this within my PHP script?> > > > I don't need to view the page, or get any acknowledgment back, just send thesingle POST variable...> > > > Thanks for your advice> > __________________________________________________ _______________> > Get Hotmail on your mobile from Vodafone > > http://clk.atdmt.com/UKM/go/107571435/direct/01/> > If you don't mind building the headers yourself in the code, it's just a >matter of using fsockopen() and then fputs().> > -Shawn> > -- > PHP General Mailing List (http://www.php.net/)> To unsubscribe, visit: http://www.php.net/unsub.php>


Hi Shawn, I have tried the following but it doesnt seem to work: foreach($_POST['newsletter-group'] as $key => $value){ $_POST['addressbookid'] = $value; $out = "POST /signup.ashx"; $fp = fsockopen("server-url", 80, $errno, $errstr, 30); if (!$fp) { echo "$errstr ($errno)<br />\n"; } else { fputs($fp, $out . "\r\n"); } fclose($fp); } Am I building the headers incorrectly?
__________________________________________________ _______________
Make a mini you on Windows Live Messenger!
http://clk.atdmt.com/UKM/go/107571437/direct/01/
Reply With Quote
  #9 (permalink)  
Old 08-27-2008
Nathan Nobbe
 
Posts: n/a
Default Re: [PHP] Re: Sending a POST variable to an ASP page

On Wed, Aug 27, 2008 at 2:41 PM, shaun thornburgh <
shaunthornburgh@hotmail.com> wrote:

> > To: php-general@lists.php.net> Date: Wed, 27 Aug 2008 14:07:31 -0500>

> From: nospam@mckenzies.net> Subject: [php] Re: Sending a POST variable to
> an ASP page> > shaun thornburgh wrote:> > Hi,> > > > I need to send a post
> variable to an ASP page, can I do this within my PHP script?> > > > I don't
> need to view the page, or get any acknowledgment back, just send the single
> POST variable...> > > > Thanks for your advice> >
> __________________________________________________ _______________> > Get
> Hotmail on your mobile from Vodafone > >
> http://clk.atdmt.com/UKM/go/107571435/direct/01/> > If you don't mind
> building the headers yourself in the code, it's just a > matter of using
> fsockopen() and then fputs().> > -Shawn> > -- > PHP General Mailing List (
> http://www.php.net/)> To unsubscribe, visit: http://www.php.net/unsub.php>
>
> Hi Shawn, I have tried the following but it doesnt seem to work:
> foreach($_POST['newsletter-group'] as $key => $value){
> $_POST['addressbookid'] = $value; $out = "POST /signup.ashx"; $fp =
> fsockopen("server-url", 80, $errno, $errstr, 30); if (!$fp) { echo
> "$errstr ($errno)<br />\n"; } else { fputs($fp, $out . "\r\n"); }
> fclose($fp); } Am I building the headers incorrectly?
> __________________________________________________ _______________
> Make a mini you on Windows Live Messenger!
> http://clk.atdmt.com/UKM/go/107571437/direct/01/




dude, honestly, why would you take that approach unless you had a particular
reason for it? especially when you can knock it out in 2 minutes w/ curl...

btw, google is pretty key as usual, try googling 'php curl post' ;)

-nathan

Reply With Quote
  #10 (permalink)  
Old 08-28-2008
Nathan Nobbe
 
Posts: n/a
Default Re: [PHP] Re: Sending a POST variable to an ASP page

say jesse,

if youre subscribed to php-general, you likely did that yourself ;)

> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, e-mail: php-general-unsubscribe@[...].net
> > For additional commands, e-mail: php-general-help@[...].net
> > To contact the list administrators, e-mail: php-list-admin@[...].net



let me know what the police have to say about it :p

-nathan

On Wed, Aug 27, 2008 at 10:32 PM, jesse church <eyeball881954@yahoo.com>wrote:

> stop emailing me......
> now............................................... .................................................. .........i
> never signed up for shit leave me alone taking me off you emailing list or i
> will file charges with the police
>
> --- On *Wed, 8/27/08, Nathan Nobbe <quickshiftin@gmail.com>* wrote:
>
> From: Nathan Nobbe <quickshiftin@gmail.com>
> Subject: Re: [php] Re: Sending a POST variable to an ASP page
> To: "shaun thornburgh" <shaunthornburgh@hotmail.com>
> Cc: php-general@lists.php.net
> Date: Wednesday, August 27, 2008, 3:45 PM
>
>
> On Wed, Aug 27, 2008 at 2:41 PM, shaun thornburgh <shaunthornburgh@hotmail.com> wrote:
>
> > > To: php-general@lists.php.net> Date: Wed, 27 Aug 2008 14:07:31

> -0500>
> > From: nospam@mckenzies.net> Subject: [php] Re: Sending a POST variable

> to
> > an ASP page> > shaun thornburgh wrote:> > Hi,> > >
> > I need to send a post
> > variable to an ASP page, can I do this within my PHP script?> > >
> > I don't
> > need to view the page, or get any acknowledgment back, just send the

> single
> > POST variable...> > > > Thanks for your advice> >
> > __________________________________________________ _______________> >

> Get
> > Hotmail on your mobile from Vodafone > >
> > http://clk.atdmt.com/UKM/go/107571435/direct/01/> > If you don't

> mind
> > building the headers yourself in the code, it's just a > matter of

> using
> > fsockopen() and then fputs().> > -Shawn> > -- > PHP General

> Mailing List (
> > http://www.php.net/)> To unsubscribe, visit:http://www.php.net/unsub.php>
> >
> > Hi Shawn, I have tried the following but it doesnt seem to work:
> > foreach($_POST['newsletter-group'] as $key => $value){
> > $_POST['addressbookid'] = $value; $out = "POST

> /signup.ashx"; $fp =
> > fsockopen("server-url", 80, $errno, $errstr, 30); if (!$fp) {

> echo
> > "$errstr ($errno)<br />\n"; } else { fputs($fp,

> $out . "\r\n"); }
> > fclose($fp); } Am I building the headers incorrectly?
> > __________________________________________________ _______________
> > Make a mini you on Windows Live Messenger!
> > http://clk.atdmt.com/UKM/go/107571437/direct/01/

>
>
>
> dude, honestly, why would you take that approach unless you had a particular
> reason for it? especially when you can knock it out in 2 minutes w/ curl...
>
> btw, google is pretty key as usual, try googling 'php curl post' ;)
>
> -nathan
>
>
>


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 12:15 AM.


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