Jump to content

Recommended Posts

I am trying to connect to cryptochat.pw chat service via php but i cant, can you tell me whats going wrong pls.

<?php
$curl_header = array('X-Requested-With: XMLHttpRequest');
  // POST the login details along with other required details to the login process page
  $ch = curl_init();
        curl_setopt($ch, CURLOPT_URL,'http://cryptochat.pw/');
        curl_setopt($ch, CURLOPT_HTTPHEADER, $curl_header);
        curl_setopt($ch, CURLOPT_USERAGENT, "Mozilla/4.0 (compatible; MSIE 5.01; Windows NT 5.0)");
        curl_setopt($ch, CURLOPT_RETURNTRANSFER, 2);
        curl_setopt($ch, CURLOPT_POST,2);
        curl_setopt($ch, CURLOPT_POSTFIELDS,urlencode('nick=test&name=aWJuRXozaWhBWHVIODZIY3QrbUJXbGtpTElqazUwUGZEbEU3TzduaUl2UGwzVnU4c2dXYnFtaXVyellSRXZWc2dTQzdQQXdUTXhrMDd1NHZQa1hPQ3c9PQ'));
        curl_setopt($ch, CURLOPT_COOKIEJAR, './cookies1.txt');
        curl_setopt($ch, CURLOPT_COOKIEFILE, './cookies1.txt');
  curl_exec($ch);

  // Once logged in, we use the same Cookies to allow us to view the home page
  // Change the url to point to any page within the InvisionPower website that requires login
  $ch = curl_init();
        curl_setopt($ch, CURLOPT_URL, "http://cryptochat.pw/index.php?chat=aWJuRXozaWhBWHVIODZIY3QrbUJXbGtpTElqazUwUGZEbEU3TzduaUl2UGwzVnU4c2dXYnFtaXVyellSRXZWc2dTQzdQQXdUTXhrMDd1NHZQa1hPQ3c9PQ&pos=0");
        curl_setopt($ch, CURLOPT_HTTPHEADER, $curl_header);
        curl_setopt($ch, CURLOPT_USERAGENT, "Mozilla/4.0 (compatible; MSIE 5.01; Windows NT 5.0)");
        curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
        curl_setopt($ch, CURLOPT_COOKIEJAR, './cookies1.txt');
        curl_setopt($ch, CURLOPT_COOKIEFILE, './cookies1.txt');
  $result = curl_exec($ch);
 echo $result;
  // Close the cURL to free up resources
  curl_close($ch);
?>
Link to comment
https://forums.phpfreaks.com/topic/282797-phpcurl-post-to-chat/
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.