Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New to the CF scene
    Join Date
    Jun 2006
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    POST and fsockopen()

    Hi Guys

    What I have done is change from one autoresponder company to another
    I have exported my email lists from previuos company.Now what happens
    is if I POST via a WEB FORM that email goes into the lead list and no verification is sent to my lead.If I add by fsockopen() the lead is added to my lead list but
    a confirmation email is sent to my lead.This I want to prevent cause I have
    changed before and I donot want to get a impression with my leads.

    So I donot want to add all 30 000 emails manually , I thought doing by fsockopen() is a better option, but then there is the barrier of the confirmation
    email.Can I overcome this please

    Here is my php script

    PHP Code:
    <?php
    # $host includes host and path and filename
       # ex: "myserver.com/this/is/path/to/file.php"
    # $query is the POST query data
       # ex: "a=thisstring&number=46&string=thatstring
    # $others is any extra headers you want to send
       # ex: "Accept-Encoding: compress, gzip\r\n"
    function post($host,$query,$others=''){
       
    $path=explode('/',$host);
       
    $host=$path[0];
       unset(
    $path[0]);
       
    $path='/'.(implode('/',$path));
       
    $post="POST $path HTTP/1.1\r\nHost: $host\r\nContent-type: application/x-www-form-urlencoded\r\n${others}User-Agent: Mozilla 4.0\r\nContent-length: ".strlen($query)."\r\nConnection: close\r\n\r\n$query";
       
    $h=fsockopen($host,80);
       
    fwrite($h,$post);
       for(
    $a=0,$r='';!$a;){
           
    $b=fread($h,8192);
           
    $r.=$b;
           
    $a=(($b=='')?1:0);
       }
       
    fclose($h);
       return 
    $r;
    }
    ?>

    Here is my query string

    $query="unit=my_list&
    from=$email&redirect=http://www.example.com/thanks.htm&
    submit=Submit&meta_adtracking=manual_form&meta_message=1&
    meta_required=name,from&meta_forward_vars=0&name=$name";

    $email and $name come from my leads file

    and here is my web form information


    Code:
    <CENTER><FORM METHOD="POST" ACTION="http://www.autorespondercompany.com/scripts/addlead.pl">
    <input type="hidden" name="unit" value="my_list">
    <input type="hidden" name="redirect" value="http://www.example.com/thanks.htm">
    <input type="hidden" name="meta_adtracking="manual_form">
    <input type="hidden" name="meta_message" value="1">
    <input type="hidden" name="meta_required" value="name,from">
    <input type="hidden" name="meta_forward_vars" value="0">
    <TABLE>
    <TR><TD COLSPAN=2><CENTER>For More Information</CENTER></TD></TR>
    <TR><TD>Your Name: </TD><TD><input TYPE="text" name="name" size="20"></TD></TR>
    <TR><TD>Your E-mail Address:</TD><TD><input TYPE="text" name="from" size="20">
    <INPUT TYPE="SUBMIT" NAME="submit" VALUE="Submit"></TD></TR>
    </TABLE>
    </FORM>
    </CENTER>
    I have also tested

    Code:
     print_r(apache_request_headers());
    on by posting to my own page using the form and I get

    Code:
    Host: www.me.com
    User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.0.4) Gecko/20060508 Firefox/1.5.0.4
    Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;
    q=0.8,image/png,*/*;q=0.5
    Accept-Language: en-us,en;q=0.5
    Accept-Encoding: gzip,deflate
    Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
    Keep-Alive: 300
    Referer: http://www.me.com/testaweberform.php
    Content-Type: application/x-www-form-urlencoded
    Content-Length: 170

    Please help, all I want is the fsockopen() connection to be treated the same as a POST so that a verification mail is not sent to my list of 30 000 leads.

    Thanks
    Niva
    Last edited by nivashni12345; 06-19-2006 at 02:25 AM.

  • #2
    Regular Coder
    Join Date
    Sep 2005
    Posts
    394
    Thanks
    1
    Thanked 0 Times in 0 Posts
    Echo out $post, in <pre></pre> tags, see what it gives you. There is perhaps a problem there somewhere.

    Code:
    <pre>
    <?php
    echo $post;
    ?>
    </pre>


  •  

    Posting Permissions

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