Jump to content

remshad

Members
  • Posts

    15
  • Joined

  • Last visited

Posts posted by remshad

  1. can you help me to make a better regexp for this situation .....?

     

    i just want to copy this html code

    Posts per day: <strong>6.03</strong><br /> 
    Threads per day: <strong>3.78</strong><br /> 
    Members per day: <strong>4.76</strong><br /> 
    Posts per member: <strong>1.27</strong><br /> 
    Replies per thread: <strong>0.6</strong> 

    from

    </td> 
    <td class="trow1" rowspan="3" valign="top"> 
    Posts per day: <strong>6.03</strong><br /> 
    Threads per day: <strong>3.78</strong><br /> 
    Members per day: <strong>4.76</strong><br /> 
    Posts per member: <strong>1.27</strong><br /> 
    Replies per thread: <strong>0.6</strong> 
    </td> 
    </tr> 

  2. while i am coding to find text between some html tags ,,

    am getting an error...

    Notice: Undefined offset: 1 in D:\xamp\xampp\htdocs\file\dash.php on line 48

     

     

    my code is at line 47 and 48 is

     

    preg_match('/<td class="trow1" rowspan="3" valign="top">(.*)<\/td> /',$dat,$regs);
    echo $etc=$regs[1]; 

     

    i am thinking copy data from

     

    </td> 
    <td class="trow1" rowspan="3" valign="top"> 
    Posts per day: <strong>6.03</strong><br /> 
    Threads per day: <strong>3.78</strong><br /> 
    Members per day: <strong>4.76</strong><br /> 
    Posts per member: <strong>1.27</strong><br /> 
    Replies per thread: <strong>0.6</strong> 
    </td> 
    </tr> 

     

     

     

    this much

     

    Posts per day: <strong>6.03</strong><br /> 
    Threads per day: <strong>3.78</strong><br /> 
    Members per day: <strong>4.76</strong><br /> 
    Posts per member: <strong>1.27</strong><br /> 
    Replies per thread: <strong>0.6</strong> 

     

     

  3. my cpanel directory php error log is filled with following error

    /usr/local/lib/php/extensions/no-debug-non-zts-20090626/: cannot open shared object file: No such file or directory in Unknown on line 0
    [11-Feb-2011 08:55:20] PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/local/lib/php/extensions/no-debug-non-zts-20090626/' - /usr/local/lib/php/extensions/no-debug-non-zts-20090626/: cannot open shared object file: No such file or directory in Unknown on line 0
    [11-Feb-2011 08:57:28] PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/local/lib/php/extensions/no-debug-non-zts-20090626/' - /usr/local/lib/php/extensions/no-debug-non-zts-20090626/: cannot open shared object file: No such file or directory in Unknown on line 0
    [11-Feb-2011 08:57:28] PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/local/lib/php/extensions/no-debug-non-zts-20090626/' - /usr/local/lib/php/extensions/no-debug-non-zts-20090626/: cannot open shared object file: No such file or directory in Unknown on line 0
    [11-Feb-2011 08:57:51] PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/local/lib/php/extensions/no-debug-non-zts-20090626/' - /usr/local/lib/php/extensions/no-debug-non-zts-20090626/: cannot open shared object file: No such file or directory in Unknown on line 0
    
    

     

     

    i think i started to obtain this error after i added dag key in my cent os 5.5 server

     

    from

    rpm -Uhv http://apt.sw.be/redhat/el5/en/x86_64/rpmforge/RPMS//rpmforge-release-0.3.6-1.el5.rf.x86_64.rpm

     

     

    can any one say ... how get rid of this error ?

  4. when i run this code shows "Warning: fclose(): supplied argument is not a valid stream resource in H:\Xamp\xampp\htdocs\proxy\kt.php on line 24"

    <?php 
    class cURL { 
    var $headers; 
    var $user_agent; 
    var $compression; 
    var $cookie_file; 
    var $proxy; 
    function cURL($cookies=TRUE,$cookie='cookies.txt',$compression='gzip',$proxy='') { 
    $this->headers[] = 'Accept: image/gif, image/x-bitmap, image/jpeg, image/pjpeg'; 
    $this->headers[] = 'Connection: Keep-Alive'; 
    $this->headers[] = 'Content-type: application/x-www-form-urlencoded;charset=UTF-8'; 
    $this->user_agent = 'Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; .NET CLR 1.0.3705; .NET CLR 1.1.4322; Media Center PC 4.0)'; 
    $this->compression=$compression; 
    $this->proxy=$proxy; 
    $this->cookies=$cookies; 
    if ($this->cookies == TRUE) $this->cookie($cookie); 
    } 
    function cookie($cookie_file) { 
    if (file_exists($cookie_file)) { 
    $this->cookie_file=$cookie_file; 
    } else { 
    fopen($cookie_file,'w') or $this->error('The cookie file could not be opened. Make sure this directory has the correct permissions'); 
    $this->cookie_file=$cookie_file; 
    fclose($this->cookie_file);
    } 
    } 
    function get($url) { 
    $process = curl_init($url); 
    curl_setopt($process, CURLOPT_HTTPHEADER, $this->headers); 
    curl_setopt($process, CURLOPT_HEADER, 0); 
    curl_setopt($process, CURLOPT_USERAGENT, $this->user_agent); 
    if ($this->cookies == TRUE) curl_setopt($process, CURLOPT_COOKIEFILE, $this->cookie_file); 
    if ($this->cookies == TRUE) curl_setopt($process, CURLOPT_COOKIEJAR, $this->cookie_file); 
    curl_setopt($process,CURLOPT_ENCODING , $this->compression); 
    curl_setopt($process, CURLOPT_TIMEOUT, 30); 
    if ($this->proxy) curl_setopt($cUrl, CURLOPT_PROXY, "&#38;#8216;proxy_ip:proxy_port&#38;#8217;"); 
    curl_setopt($process, CURLOPT_RETURNTRANSFER, 1); 
    curl_setopt($process, CURLOPT_FOLLOWLOCATION, 1); 
    $return = curl_exec($process); 
    curl_close($process); 
    return $return; 
    } 
    function post($url,$data) { 
    $process = curl_init($url); 
    curl_setopt($process, CURLOPT_HTTPHEADER, $this->headers); 
    curl_setopt($process, CURLOPT_HEADER, 1); 
    curl_setopt($process, CURLOPT_USERAGENT, $this->user_agent); 
    if ($this->cookies == TRUE) curl_setopt($process, CURLOPT_COOKIEFILE, $this->cookie_file); 
    if ($this->cookies == TRUE) curl_setopt($process, CURLOPT_COOKIEJAR, $this->cookie_file); 
    curl_setopt($process, CURLOPT_ENCODING , $this->compression); 
    curl_setopt($process, CURLOPT_TIMEOUT, 30); 
    if ($this->proxy) curl_setopt($process, CURLOPT_PROXY, $this->proxy); 
    curl_setopt($process, CURLOPT_POSTFIELDS, $data); 
    curl_setopt($process, CURLOPT_RETURNTRANSFER, 1); 
    curl_setopt($process, CURLOPT_FOLLOWLOCATION, 1); 
    curl_setopt($process, CURLOPT_POST, 1); 
    $return = curl_exec($process); 
    curl_close($process); 
    return $return; 
    } 
    function error($error) { 
    echo "<center><div style='width:500px;border: 3px solid #FFEEFF; padding: 3px; background-color: #FFDDFF;font-family: verdana; font-size: 
    
    10px'><b>cURL Error</b><br>$error</div></center>"; 
    die; 
    } 
    } 
    $cc = new cURL(); 
    $cc->get('http://localhost/upload/showthread.php?tid=1'); 
    $cc->post('http://localhost/upload/showthread.php?tid=1','foo=bar'); 
    ?>

     

     

    i dont know more about php

    please help me

  5. when i was run

    <?php 
    class cURL { 
    var $headers; 
    var $user_agent; 
    var $compression; 
    var $cookie_file; 
    var $proxy; 
    function cURL($cookies=TRUE,$cookie='cookies.txt',$compression='gzip',$proxy='') { 
    $this->headers[] = 'Accept: image/gif, image/x-bitmap, image/jpeg, image/pjpeg'; 
    $this->headers[] = 'Connection: Keep-Alive'; 
    $this->headers[] = 'Content-type: application/x-www-form-urlencoded;charset=UTF-8'; 
    $this->user_agent = 'Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; .NET CLR 1.0.3705; .NET CLR 1.1.4322; Media Center PC 4.0)'; 
    $this->compression=$compression; 
    $this->proxy=$proxy; 
    $this->cookies=$cookies; 
    if ($this->cookies == TRUE) $this->cookie($cookie); 
    } 
    function cookie($cookie_file) { 
    if (file_exists($cookie_file)) { 
    $this->cookie_file=$cookie_file; 
    } else { 
    fopen($cookie_file,'w') or $this->error('The cookie file could not be opened. Make sure this directory has the correct permissions'); 
    $this->cookie_file=$cookie_file; 
    fclose($this->cookie_file); 
    } 
    } 
    function get($url) { 
    $process = curl_init($url); 
    curl_setopt($process, CURLOPT_HTTPHEADER, $this->headers); 
    curl_setopt($process, CURLOPT_HEADER, 0); 
    curl_setopt($process, CURLOPT_USERAGENT, $this->user_agent); 
    if ($this->cookies == TRUE) curl_setopt($process, CURLOPT_COOKIEFILE, $this->cookie_file); 
    if ($this->cookies == TRUE) curl_setopt($process, CURLOPT_COOKIEJAR, $this->cookie_file); 
    curl_setopt($process,CURLOPT_ENCODING , $this->compression); 
    curl_setopt($process, CURLOPT_TIMEOUT, 30); 
    if ($this->proxy) curl_setopt($cUrl, CURLOPT_PROXY, ‘proxy_ip:proxy_port’); 
    curl_setopt($process, CURLOPT_RETURNTRANSFER, 1); 
    curl_setopt($process, CURLOPT_FOLLOWLOCATION, 1); 
    $return = curl_exec($process); 
    curl_close($process); 
    return $return; 
    } 
    function post($url,$data) { 
    $process = curl_init($url); 
    curl_setopt($process, CURLOPT_HTTPHEADER, $this->headers); 
    curl_setopt($process, CURLOPT_HEADER, 1); 
    curl_setopt($process, CURLOPT_USERAGENT, $this->user_agent); 
    if ($this->cookies == TRUE) curl_setopt($process, CURLOPT_COOKIEFILE, $this->cookie_file); 
    if ($this->cookies == TRUE) curl_setopt($process, CURLOPT_COOKIEJAR, $this->cookie_file); 
    curl_setopt($process, CURLOPT_ENCODING , $this->compression); 
    curl_setopt($process, CURLOPT_TIMEOUT, 30); 
    if ($this->proxy) curl_setopt($process, CURLOPT_PROXY, $this->proxy); 
    curl_setopt($process, CURLOPT_POSTFIELDS, $data); 
    curl_setopt($process, CURLOPT_RETURNTRANSFER, 1); 
    curl_setopt($process, CURLOPT_FOLLOWLOCATION, 1); 
    curl_setopt($process, CURLOPT_POST, 1); 
    $return = curl_exec($process); 
    curl_close($process); 
    return $return; 
    } 
    function error($error) { 
    echo "<center><div style='width:500px;border: 3px solid #FFEEFF; padding: 3px; background-color: #FFDDFF;font-family: verdana; font-size: 10px'><b>cURL Error</b><br>$error</div></center>"; 
    die; 
    } 
    } 
    $cc = new cURL(); 
    $cc->get('http://www.college-seminars.com'); 
    $cc->post('http://localhost/proxy/','foo=bar'); 
    ?>
    

     

     

    shows Parse error: parse error in H:\Xamp\xampp\htdocs\proxy\kt.php on line 36

     

     

    but changed the code but nothing work , please am a beginner

  6. i am  running a mirror hosting website

    for that i created a php script which copies remote files from other server to my

    but i think to make a modification on this for copy files which is password protected,

     

    see the code

    <?PHP
    
    $url=$_POST["name"];
    $file = file_get_contents($_POST["name"]); # get our file data
    $filename = basename($url);
    $fp = fopen($_SEVER['DOCUMENT_ROOT'].$filename, "w", 0); # create then open for writing
      fputs($fp, $file); # write all of $data to our opened file
      fclose($fp); # close the file
      echo "Succesful";
    
    ?> 

     

    (this script is activated by a html form where i need to put url)

     

    if i have a username and password in remote hosted server how to use cookies,

    i dont know how to send cookies via php

     

    please help me

  7. when i  try to make a script that omit desired number of text box for entering data

     

    when i run the script  error showing "Parse error: parse error, expecting `','' or `';'' in L:\xampp\htdocs\forums\me\PROJECT\first.php on line"

     

    i below add the php script

     

     

    echo "<form action="finish.php" method="post">";
    echo "STD: <input type="text" name="std" />";
    echo "DIVISION:<input type="text" name="division" />";
    for($i=1;$i<=$number;$i++)
    { echo "enter".$i." th subject =: <input type="text" name="".$i."std" />";
    }
    echo "<input type="submit" />";

     

     

    could you help me for fix this problem

×
×
  • 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.