SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Wizard silver trophy
    beley's Avatar
    Join Date
    May 2001
    Location
    LaGrange, Georgia
    Posts
    6,117
    Mentioned
    3 Post(s)
    Tagged
    0 Thread(s)

    Help w/ PHP & cURL

    My script takes form data and changes the 'recipient' field to the appropriate email address, and is then supposed to send the post data to the form processing script (formmail) on the server.

    Here is the script:

    PHP Code:
    <?php
           $recip 
    =    array("Email" => "email@email.com",
                             
    "Email2" => "email2@email.com");
       
           
    $HTTP_POST_VARS['recipient'] = $recip[$_POST['recipient']];
       
           echo 
    $HTTP_POST_VARS['recipient'];
       
           
    $ch curl_init();
       
           
    curl_setopt($chCURLOPT_URL,"http://www.website.com/cgi-sys/formmail.pl");
           
    curl_setopt($chCURLOPT_POST1);
           
    curl_setopt($chCURLOPT_POSTFIELDS$HTTP_POST_VARS);
       
           
    curl_exec ($ch);
           
    curl_close ($ch);
       
    ?>
    The problem is that it's not actually posting to the form processor, it's staying on this script. The form processor is supposed to redirect after processing to either an error page or a success thank you page, but instead it's getting a a found error:
    Found

    The document has moved here.
    Any idea how I can get cURL to actuallly post the data and transfer/redirect to the script?

  2. #2
    SitePoint Wizard silver trophy
    beley's Avatar
    Join Date
    May 2001
    Location
    LaGrange, Georgia
    Posts
    6,117
    Mentioned
    3 Post(s)
    Tagged
    0 Thread(s)
    Anyone?

  3. #3
    SitePoint Wizard silver trophy
    beley's Avatar
    Join Date
    May 2001
    Location
    LaGrange, Georgia
    Posts
    6,117
    Mentioned
    3 Post(s)
    Tagged
    0 Thread(s)
    I'm willing to pay for a solution to this problem. If anyone is willing to help me, please PM me.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •