Mobile phone novel, click on the next page, trigger the advertisement, how to achieve this?

such as the title, when I click to go to the next page, trigger the site ad, go back and click to go to the next page. Ad codes are generated at random. How do I do this?

Mar.19,2021

visually observe that this type of mobile project will not be popular

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1eac06a-20a2.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1eac06a-20a2.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?