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