Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9277635
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T17:09:24+00:00 2026-06-18T17:09:24+00:00

I have this code to login to a server called Pinger TextFree for a

  • 0

I have this code to login to a server called Pinger TextFree for a bot I’m working on:

<?php
function sendRequest($url, $postorget, $fields = array(), $proxy)
{
    $cookie_file = "cookies.txt";

    //Initiate connection
    $ch = curl_init();

    curl_setopt($ch, CURLOPT_HTTPHEADER, $header); // set url
    curl_setopt($ch, CURLOPT_HEADER, false);
    curl_setopt($ch, CURLOPT_URL, $url); // set url
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); // return the transfer
    curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); // allow https
    curl_setopt($ch, CURLOPT_USERAGENT, 'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; .NET CLR 1.1.4322)'); // random agent
    curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1); // automatically follow Location: headers (ie redirects)
    curl_setopt($ch, CURLOPT_AUTOREFERER, 1); // auto set the referer in the event of a redirect
    curl_setopt($ch, CURLOPT_MAXREDIRS, 5); // ibm likes to redirect a lot, make sure we dont get stuck in a loop
    curl_setopt($ch, CURLOPT_COOKIEJAR, $cookie_file); // file to save cookies in
    curl_setopt($ch, CURLOPT_COOKIEFILE, $cookie_file); // file to read cookies from
    curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 40); //timeout time for curl
    curl_setopt($ch, CURLOPT_PORT, 80); //port to connect to (default 80 obviously)

    //Check to see if a proxy is being used
    if(isset($proxy)){
        //Tell cURL you're using a proxy
        curl_setopt($ch, CURLOPT_PROXYTYPE, CURLPROXY_SOCKS5);
        //Set the proxy
        curl_setopt($ch, CURLOPT_PROXY, $proxy); 
    }

    //Check if request is POST or GET
    if ($postorget == "post" OR $postorget == "POST")
    {
        curl_setopt($ch, CURLOPT_POST, true); // use POST
        if (is_array($fields)){
            curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($fields)); // key => name gets turned into &key=name
        } else {
            curl_setopt($ch, CURLOPT_POSTFIELDS, $fields); // &key=name passed in
        }
    } else { 
        curl_setopt($ch, CURLOPT_POST, false); // use GET
    }

    $content = curl_exec($ch); // return html content
    $info = curl_getinfo($ch); // return transfer info
    $error = curl_error($ch);  // return any errors

    curl_close($ch);

    $request = array('content' => $content,
             'error' => $error,
         'info' => $info);

    return $request;            
}

//Login details
$username = "usernamehere";
$password = "passwordhere";

//GET the initial login page
$initFields = "";
$initOutput = sendRequest("http://www.pinger.com/tfw/?t=1360619019053", "GET", $initFields);

echo "<textarea cols='100' rows='400'>";
print_r($initOutput);
echo "</textarea>";

//Login to pinger
$loginFields = "{\"username\":\"".$username."\",\"password\":\"".$password."\",\"clientId\":\"textfree-in-flash-web-free-1360619009-8CA1C5C1-38ED-2E31-3248-CB367450A20F\"}";
$loginOutput = sendRequest("https://api.pinger.com/1.0/web/login", "POST", $loginFields);

echo "<textarea cols='100' rows='400'>";
print_r($loginOutput);
echo "</textarea>";

?>

For some reason every time I try to run this script all I get is “Unknown SSL protocol error in connection to api.pinger.com:80”

What am I doing wrong here? I’ll even specify SSL2 in the setop but it just hangs forever – I just can’t get this to work!

Here is the app I’m trying to automate: http://www.pinger.com/tfw/

It’s in flash but I’m using Fiddler to sniff the HTTP/HTTPS requests to automate them with cURL.

Any ideas from you guys?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-18T17:09:25+00:00Added an answer on June 18, 2026 at 5:09 pm

    The error is obviously in the line

    curl_setopt($ch, CURLOPT_PORT, 80); //port to connect to (default 80 obviously)
    

    HTTPS servers listen on port 443 by default. Simply deleting this line should be sufficient; curl will then figure out the port from the protocol in the URL.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have this horribly stripped delphi code that basically login to server, save cookie
I have this code for displaying content for login and registration in my PHP
I have this code in JS: if($('.log input:checked')) { alert('login checked'); alert('do what you
I am trying to Login or SugarCrm using REST. I have this code,, //Login
I have a file called TasksLogin.php which lets me login session_start(); require_once 'google-api-php-client/src/Google_Client.php'; require_once
I have this problem. I have a function for example called functionA() that needs
I have a codeigniter application.This is my code in view page. function click_next(){ var
So, I have this code in a controller: before_filter :require_login, :only => :new, :edit,
i have this code, and need help with the logic end. I would like
I have a problem with the logic of this code, XNA's Update Method is

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.