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

  • Home
  • SEARCH
  • 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 8073637
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T14:23:38+00:00 2026-06-05T14:23:38+00:00

What is Delphi equivalent to fsockopen function in php? in PHP Manual : resource

  • 0

What is Delphi equivalent to “fsockopen” function in php?

in PHP Manual:

resource fsockopen ( string $hostname [, int $port = -1 [, int &$errno [, string &$errstr     [, float $timeout = ini_get("default_socket_timeout") ]]]] )
Initiates a socket connection to the resource specified by hostname.

My code is fully:

function accountcreate($username, $password, $connection, $bandwidth, $disabledate,  $disabletime)
{
$adminpassword='';
$adminport=82;
$proxyaddress='127.1.1.1';

$fp = fsockopen($proxyaddress, $adminport, &$errno, &$errstr, 1000);
if(!$fp) 
{
        echo "$errstr ($errno)<br>\n";
} 
else 
{
    $url_ = "/account";
    $url = "add=1"."&";
    .
    .
    $url = $url."userid=-1";
    $len = "Content-Length: ".strlen($url);
    $auth = "Authorization: Basic ".base64_encode("admin:".$adminpassword);
    $msg = "POST ".$url_." HTTP/1.0\r\nHost: ".$proxyaddress."\r\n".$auth."\r\n".$len."\r\n"."\r\n".$url;
    fputs($fp,$msg);
    echo $msg;

    fclose($fp);
}

that code make a new account in ccproxy.

  • 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-05T14:23:40+00:00Added an answer on June 5, 2026 at 2:23 pm

    Perhaps have a look at the Indy Components that ship with Delphi (assuming at least Delphi7). You would need :

    TIdTCPConnection Documentation

    which contains an IOHandler property (TIdIOHandler) where you specify the parameters used in fsockopen:

    TIdTCPConnection.IOHandler Property

    TIdIOHandler Documentation

    As others have noted, however, you probably would be well served by looking at the bigger picture in your PHP code and perhaps implementing its functionality with a higher level tool like TIdHTTP :

    TIdHTTP Documentation

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

Sidebar

Related Questions

I'm looking for RTL delphi function equivalent to the sscanf/swscanf C++ functions. Exist something
Does anyone know what's the .NET/C# equivalent of Delphi's forceDirectory function ? For who
I am trying to write a function to transform a string literal in Delphi/pascal
Is there a Delphi equivalent of the C utoa function, that allows me to
I'm looking for the equivalent to the Graphics.StringToColor function to convert a string to
Is there a function in Delphi equivalent to Cocoa's stringByTrimmingCharactersInSet ? What I need
Is there any equivalent of DocTest for Delphi. I use DUnit but I like
Does anyone know of an equivalent to FxCop/StyleCop for Delphi? I would really like
Exist a .net class equivalent to the TTimer delphi component? TTimer is used to
Does .net have the equivilent of Delphi's QuotedStr function. This replaces all quotes with

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.