How to use cookies to prevent users from flooding back

Source: Internet
Author: User
How to use cookies to prevent users from flooding back?
It's all right. A link to the Phoenix http://yue.ifeng.com/y/detail_2011_12/07/11160676_0.shtml

Comment Box content is: Civilized Internet, login comments!

Direct Point Button JS Alert please fill in the comment content

Just a little bit. text box text box content becomes: Please login first, then post a comment.

Click on the button and submit.

The latest comments in the open page are available. And then I copied some HTML.

HTML Code
  
   
  
   

Submit it and have it.
And then think of the effect of using curl post to simulate the form, but it's probably missing something.
PHP Code
  Header ("CONTENT-TYPE:TEXT/HTML;CHARSET:UTF-8;"); *chid 21202content mmmmmmmmmdocid 11160676docName Wu Zhouxi girlfriend Xin Zhang home big-scale lingerie selfie hot exposure docurl Http://yue.ifeng.com/y/detai   l_2011_12/07/11160676_0.shtml*/$url = "http://comment.ifeng.com/post.php";  $url = "http://localhost/php/index.php"; $data = Array (' content ' = ' xxxxxxxxxxoooooooooooo ', ' docId ' =>11160676, ' docname ' + ' Wu Zhouxi girlfriend Xin Zhang give home a large scale underwear selfie hot exposure Light ', ' docurl ' = ' http://yue.ifeng.com/y/detail_2011_12/07/11160676_0.shtml ', ' chId ' =>21202);             $ret = Http_post ($url, $data), Var_dump ($ret), function Http_post ($url, $data) {$ch = Curl_init ();     curl_setopt ($ch, curlopt_header,1);         curl_setopt ($ch, Curlopt_returntransfer, 1);     curl_setopt ($ch, Curlopt_url, $url);     curl_setopt ($ch, Curlopt_post, 1);     $data = Http_build_query ($data);          curl_setopt ($ch, Curlopt_postfields, $data);     curl_setopt ($ch, Curlopt_referer, "http://yue.ifeng.com/y/detail_2011_12/07/11160676_0.shtml"); $cooKie = "userid=1323532473389_2814";          curl_setopt ($ch, Curlopt_cookie, $cookie);     $rs = curl_exec ($ch);     Curl_close ($ch); return $rs; }


The problems encountered are:
1. Comments on the person's avatar is not the same as the other gray normal is silver. I changed the browser to open the link did not see the content of the irrigation and then I use Firebug Firecookie plugin to look at the cookie found that there is a userid and cmtids no irrigation a cmtids on one more

Http://comment.ifeng.com/view.php?doc_url=http%3A%2F%2Fyue.ifeng.com%2Fy%2Fdetail_2011_12%2F07%2F11160676_0. shtml&doc_name=%e5%90%b4%e5%8d%93%e7%be%b2%e5%a5%b3%e5%8f%8b%e5%bc%a0%e9%a6%a8%e4%ba%88%e5%ae%b6%e4%b8%ad% e5%a4%a7%e5%b0%ba%e5%ba%a6%e5%86%85%e8%a1%a3%e8%87%aa%e6%8b%8d%e7%85%a7%e7%81%ab%e8%be%a3%e6%9b%9d%e5%85%89 &ishot=no

I clean Cookie Refresh page cookie appears userid = 1323533123324_5513
Submit it with the above HTML Cmtids = 45583 One More time Cmtids = 45583_45612
Cleaning up the cookie is gone.

2. Why do you want to hold such a comment? Since it is necessary to log in to comment ... JS not judge good to the latest review page shows a fake?

Little brother Caishuxueqian, nothing blind tinkering a bit, hope you heroes help analyze ... Rattle

------Solution--------------------
Just went to see, it is really directly submitted, this site is really enough loose ...

If Curl direct submission is not accepted, it is likely that there are some additional requirements (such as a specific cookie) on the server side, it is recommended to look at the HTTP data stream when the Web page is submitted, and then use curl to simulate a bit more fully, should be able to handle.
  • Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.