fandelost  [ Profile ]

Sort by: Date / Title /

  1. 2 months ago
    1. function ajax(url, vars, callbackFunction) { var request = new XMLHttpRequest(); request.open("POST", url, true); request.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); request.onreadystatechange = function() { if (request.readyState == 4 && request.status == 200) { if (request.responseText) { callbackFunction(request.responseText); } } }; request.send(vars); }
  2. 2 months ago
    1. <?php
    2. class cpanel
    3. {
    4.     /** 
    5.     * @var        resource        contains curl resource for communication with cpanel 
    6.     **/
    7.     var $socket ;
    8.     /**
    9.     * @param    string            username          your cpanel username
    10.     * @param    string            password          your cpanel password
    11.     * @param    string            hostname          your cpanel hostname
    12.     * @param    bool            ssl                  indicate ssl availability
    13.     * @param    string            theme              indicate the theme being used
    14.     * @return    void
    15.     *
    16.     * This will give you the default settings of using ssl and X as the theme
    17.     * <code><?php $cpanel = new cpanel( 'username', 'password', 'hostname' ); ?></code>
    18.     * 
    19.     * This will allow you to disable SSL
    20.     * <code><?php $cpanel = new cpanel( 'username', 'password', 'hostname', false ); ?></code>
    21.     * 
    22.     * This will allow you to disable SSL and change the theme
    23.     * <code><?php $cpanel = new cpanel( 'username', 'password', 'hostname', false, 'mytheme' ); ?></code>
    24.     **/
    25.     function cpanel( $username, $password, $hostname, $ssl = true, $theme = 'x' )
    26.     {
    27.         $this->ssl = $ssl ;
    28.         $this->username = $username ;
    29.         $this->password = $password ;
    30.         $this->hostname = $hostname ;
    31.         $this->request = $request ;
    32.         $this->theme = $theme ;
    33.          
    34.         if( !( $this->socket = @curl_init( ) ) ): die('FATAL : Cannot initialize curl');
    35.             return;
    36.         else:     
    37.             if( $this->ssl ):
    38.                 curl_setopt( $this->socket, CURLOPT_SSL_VERIFYPEER, 0 );                 
    39.                 curl_setopt( $this->socket, CURLOPT_SSL_VERIFYHOST, 0 );
    40.             endif;
    41.              
    42.             curl_setopt( $this->socket, CURLOPT_FOLLOWLOCATION, 1 );
    43.             curl_setopt( $this->socket, CURLOPT_HEADER, 0 );
    44.             curl_setopt( $this->socket, CURLOPT_RETURNTRANSFER, 1 );
    45.             curl_setopt( $this->socket, CURLOPT_HTTPHEADER, 
    46.             array( sprintf( "Authorization: Basic %s", base64_encode( sprintf( '%s:%s', $this->username, $this->password ) ) ) )
    47.             );
    48.         endif;     
    49.          
    50.         if( ereg( 'Login Attempt Failed', $this->make_request( sprintf( '/frontend/%s/', $this->theme ) ) ) )
    51.             die("Cannot login to cpanel");
    52.     }
    53.     /**
    54.     * @param    string            request            the page to retrieve from cpanel
    55.     * @return    string            returns raw data
    56.     *
    57.     * This would retrieve the index page from cpanel
    58.     * <code><?php $cpanel->make_request( "/frontend/$cpanel->theme" ); ?>
    59.     **/
    60.     function make_request( $request )
    61.     {
    62.         if( $this->ssl )
    63.             curl_setopt( $this->socket, CURLOPT_URL, sprintf( "https://%s:2083%s",$this->hostname$request ) );
    64.         else
    65.             curl_setopt( $this->socket, CURLOPT_URL, sprintf( "http://%s:2082%s",$this->hostname$request ) );
    66.          
    67.         return curl_exec( $this->socket );
    68.     }
    69.     /**
    70.     * @return    string            returns html tables of table from cpanel index
    71.     *
    72.     * This example method returns all your account information from cpanel index, unformatted
    73.     * <code><?php echo $cpanel->account_tables( ); ?></code>
    74.     **/
    75.     function account_tables( )
    76.     {
    77.         preg_match_all( '#(<table width="275" border="0" cellspacing="3" cellpadding="4">.*?[^<]</table>)#si'
    78.                         $this->make_request( sprintf( "/frontend/%s/", $this->theme ) )
    79.                         $return 
    80.         );
    81.         return implode( "<br />", $return[0] );
    82.     }
    83.     /**
    84.     * This method closes the curl resource
    85.     *
    86.     * <code><?php $cpanel->_close( ); ?></code>
    87.     **/     
    88.     function _close( )
    89.     {
    90.         return @curl_close( $this->socket );
    91.     }
    92. }
    93. $cpanel = new cpanel( "username", "password", "hostname" );
    94.  
    95. echo $cpanel->account_tables( );
    96.  
    97. $cpanel->_close( );
    98. ?>
  3. 2 months ago
    1. var pars = Form.serialize($('form'));
  4. 5 months ago
    1. .foo {
    2. min-height:100px;
    3. height: auto !important;
    4. height: 100px;
    5. }
  5. 6 months ago
    Paste on browser's location bar et voilĂ !
    1. javascript:document.cookie = "COUNTRY = FR";location.reload(true);
  6. 6 months ago
    1. <object type="application/x-shockwave-flash" style="width:425px; height:350px" data="http://www.youtube.com/v/ulakMBcqyPo"><param name="movie" value="http://www.youtube.com/v/ulakMBcqyPo" /><param name="wmode" value="transparent" /></object>

First / Previous / Next / Last / Page 1 of 1 (6 posteets)