PHP scrambling, post,mysql connection, crawl Web _php tutorial

Source: Internet
Author: User
Post

 
  ' 0 ',    ' pwd ' = ' 1 ',);/* $pageContents = httpclient::quickpost (' http://xxxxxxxxx ', $params); echo $pageContents; * /$client = new HttpClient (' xxxxxx '); $client->setdebug (true); $client->post ('/action ', $params); Echo $client- >getcontent ();//foreach (Json_decode ($client->getcontent (), true) as $item)//echo $item [' name ']. '
';? > ' 0 ', ' pwd ' = ' 1 ',);/* $pageContents = httpclient::quickpost (' http://xxxxxxxxx ', $params); echo $ pagecontents;*/$client = new HttpClient (' xxxxxx '); $client->setdebug (true); $client->post ('/action ', $params); echo $client->getcontent ();//foreach (Json_decode ($client->getcontent (), true) as $item)//echo $item [' name ']. '
';? >

MySQL Connection:

 ";    echo "ASDFASDFADSF"; $mysql _server_name= "xxxxx"; Database server name $mysql _username= "root"; Connect database user name $mysql _password= "root"; Connect the database Password $mysql _database= "bookshop"; Database name//Connect to Database $conn =mysql_connect ($mysql _server_name, $mysql _username, $mysql _PASSW                             ORD);    The SQL statement that extracts information from the table $strsql = "SELECT * from ' book '";    Execute SQL query $result =mysql_db_query ($mysql _database, $strsql, $conn);             Get query Results $row =mysql_fetch_row ($result);    Echo '; Echo '
 
  
 
  '.      Mysql_field_name ($result, $i);    echo ""; } echo "
 
 
  ';        echo $row [$i];      Echo '; } echo "
 
 
 
  
  '; Show Field name echo "
  
  
     "; for ($i =0; $i 
   "; Locate the first record Mysql_data_seek ($result, 0); Loop out record while ($row =mysql_fetch_row ($result)) {echo " 
   
     "; for ($i =0; $i 
   "; } echo " 
  
"; echo ""; Release Resource Mysql_free_result ($result); Close connection mysql_close ($conn); ?>

Crawling Web pages:

!--? php header ("content-type:text/html; CHARSET=GBK "); $url = ' http://ipanda3.taobao.com/'; $lines _string=file_get_contents ($url); echo $lines _string;  
Crawl An element of the Web page, using simple_html_dom:



http://www.bkjia.com/phpjc/735875.html www.bkjia.com true http://www.bkjia.com/phpjc/735875.html techarticle post ' 0 ', ' pwd ' = ' 1 ',);/* $pageContents = HttpClient:: Quickpost (' http://xxxxxxxxx ', $params); echo $pageContents; */$client = new HttpClient (' xxxxxx '); $client->setdebug (true); $client ...

  • Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.