JS inside the reference to the data returned by PHP, why not update it yourself?

Source: Internet
Author: User
The following code, is JS inside to do a timer, PHP in the database to retrieve the latest value assigned to JS inside the variable ads after the pop-up, and then every 5 seconds to perform the same process, but each popup is not the latest value, the fact that the data has been updated, which is why AH?

Header ("content-type:text/html; Charset=utf-8 ");
Date_default_timezone_set (' PRC ');
Include "btcconn.inc.php";
$pdo = new PDO ($DSN, $user, $password, $options);
?>


Reply to discussion (solution)

The PHP code embedded in the JS code is executed only when the page is loaded. It won't be executed again.

Thanks for the above, haha.

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