fsockopen setup

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    fsockopen setup

    friends, is it possible to enable the service by .htacess/php ini/ or any php file? how to know that my server Support this service or not? Plz post some details about it ...Thank u

    #2
    then try to use file_get_contents();
    com site: http://vampist.net
    download site: http://wapdloads.net
    fb: http://www.facebook.com/pmplx

    Comment


      #3
      you can check like


      PHP Code:
      <?php
      If(function_exists("fsockopen")){
              echo 
      'Function Exists';
      }
      Else{
              echo 
      'function does not exist';
      }
      ?>
      or











      PHP Code:
      <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
      <html xmlns="http://www.w3.org/1999/xhtml">

      <head>
      <meta http-equiv="Content-Language" content="en-gb" />
      <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
      <title>PHP Function Test</title>

      </head>

      <body>


      PHP mail() and fsockopen function test.
      <p >
      Send Mail check follows.. no error indicates it's working.</p>

      <?php
      // The message
      $message "Line 1\nLine 2\nLine 3";


      // Send
      mail('mailcheck@somecrappyfakedomainname.whatver.com''test subject'$message);
      ?> 

      <p>
      FSOCKOPEN test follows: </p>
      <p>
      <b>
      <?
      echo get_url_title("http://news.bbc.co.uk");

      function get_url_title($url, $timeout = 2)
      {
          $url = parse_url($url);

          if(!in_array($url['scheme'],array('','http')))
              return;

          $fp = fsockopen ($url['host'], ($url['port'] > 0 ? $url['port'] : 80), $errno, $errstr, $timeout);
          if (!$fp)
          {
              return;
              // echo "$errstr ($errno)<br>\n";
          }
          else
          {
              fputs ($fp, "GET /".$url['path'].($url['query'] ? '?'.$url['query'] : '')." HTTP/1.0\r\nHost: ".$url['host']."\r\n\r\n");
              $d = '';
             
              while (!feof($fp))
              {
                  $d .= fgets ($fp,2048);

                  if(preg_match('~(</head>|<body>|(<title>\s*(.*?)\s*</title>))~i', $d, $m))
                      break;
              }
              fclose ($fp);

              return $m[3];
          }
      }

      ?>
      </b>
      </p>
      <p></p>
      <p></p>
      FSOCKOPEN test ends. </p>
      <p></p>

      <p>PHP Info Follows:</p>
      <p></p>
      <p ><? phpinfo(); ?></p>

      </body>

      </html>
      Last edited by GiLL; 01.05.10, 03:39.
      left wap stuff

      Comment


        #4
        Get info easily
        <?
        phpinfo();
        ?>
        This is my new community for wap coding. Come and join and experience real wap coding
        http://leonine.6te.net

        Comment

        Working...
        X