How does php obtain Baidu Music API address! First urgent file
Query ("select * from {$ dbtbpre} ecms_yue where id = '". $ id. "'"); // query the data table require ('Template/yue. temp. php '); // import template file} db_close (); // Close the MYSQL link $ empire = null; // injection operation variable?>
Second file
Fetch ($ SQL) // Obtain query records cyclically {?> {"Songid ":
,},
Above is a php loop code 2 files
Http: // localhost: 82/e/song /? Id = 1322
The connection is like this! The program is the Emperor CMS
There is a music library in the data table! There are two fields under the singer and title
Access the address above to obtain the Baidu Music address.
The artist and title are directly indicated by ID /? Id = 1322 get the singer and title value from the Emperor CMS
The following is a simulated retrieval method.
Fetch ($ SQL) // Obtain query records cyclically {?> {"Songid ":
, "Songurl": output the music address here ,},
$
'; $ Lines_string = file_get_contents ($ url); eregi ('(.*)', // Capture the previous part of eregi ('
(.*)
', // Capture the MP3 file name $ lines_string, $ title); echo htmlspecialchars ($ title [0]);}?> // Note that Baidu's music connection should not be removed! For other sites! // You cannot play back multiple garbled characters behind Baidu! // Remove the wma format! MP3! Output 1 piece of data randomly! // Output only one page refresh several times. The output result is also changed! If there are too many addresses, you 'd better take the lyrics ID as a dish.
I wrote the above code in disorder! Write it in disorder!
I won't write PHP! Only here!
Reply to discussion (solution)
Http://blog.csdn.net/iloster/article/details/8694014