1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

Auto submit form using php

Discussion in 'PHP' started by PinoyIto, Sep 15, 2006.

  1. #1
    Hello, how can I auto submit a form using php? I know this is posible in javascript but I am not sure with PHP. If can, will you please post a sample how to do it...
    SEMrush
     
    PinoyIto, Sep 15, 2006 IP
    SEMrush
  2. vdd

    vdd Peon

    Messages:
    34
    Likes Received:
    5
    Best Answers:
    0
    Trophy Points:
    0
    #2
    It's possible and not too difficult. Use Curl library.
     
    vdd, Sep 15, 2006 IP
  3. PinoyIto

    PinoyIto Notable Member

    Messages:
    5,863
    Likes Received:
    170
    Best Answers:
    0
    Trophy Points:
    260
    #3
    Can you please show me some samples
     
    PinoyIto, Sep 15, 2006 IP
  4. vdd

    vdd Peon

    Messages:
    34
    Likes Received:
    5
    Best Answers:
    0
    Trophy Points:
    0
    #4
    POST example:
    <?
       $url = 'http://localhost/curl/1.php';
       $params = "keyword=123&zxczxc=333"; //you must know what you want to post
       $user_agent = "Mozilla/5.0 (compatible; MSIE 5.01; Windows NT 5.0)";
       $ch = curl_init();
       curl_setopt($ch, CURLOPT_POST,1);
       curl_setopt($ch, CURLOPT_POSTFIELDS,$params);
       curl_setopt($ch, CURLOPT_URL,$url);
       curl_setopt($ch, CURLOPT_USERAGENT, $user_agent);
       curl_setopt($ch, CURLOPT_RETURNTRANSFER,1);
    
       $result=curl_exec ($ch);
       curl_close ($ch);
    
       echo "Results: <br>".$result;
    ?>
    PHP:
    1.php (just for test)
    <?
    print_r($_POST);
    ?>
    PHP:
     
    vdd, Sep 15, 2006 IP
    drewnick likes this.
  5. PinoyIto

    PinoyIto Notable Member

    Messages:
    5,863
    Likes Received:
    170
    Best Answers:
    0
    Trophy Points:
    260
    #5
    Thank you very much mate....
     
    PinoyIto, Sep 16, 2006 IP
  6. chirayu

    chirayu Peon

    Messages:
    29
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #6
    Hi PinoyITO,

    I am looking for auto form fill up javascript code. I am looking for that. If any one can provide me, kindly contact me at

    Thanks a lot in advance.
     
    chirayu, Jun 5, 2008 IP
  7. CasTex

    CasTex Member

    Messages:
    31
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    41
    #7
    Your script needs some tweaks though.
     
    CasTex, Feb 2, 2012 IP