'Chrome runs PHP script twice when press Enter in Address Bar
A very odd glitch I've encountered recently. I run Chrome Version 98.0.4758.81 (Official Build) (64-bit) (first noticed issue on v.97). When I run my PHP script for the first time by entering URL - it runs 1 time. When I press RELOAD button - it runs one time too. But when I put cursor to Adress bar with needed URL already there and press ENTER - script runs 2 times. Disabling pages prefetching does not help. No session_start(), html etc. Pure php script that works with BD and executes in 12-15 seconds (each run). Edge works fine - when I RELOAD or press ENTER.
So, here is the code that runs 2 times, when I press ENTER in adress BAR
<?php
include_once('/home/alex/public_html/dev/config.inc.php'); // just varibles
$conni = mysqli_connect("", $db_user, $db_pass, $db_name);
mysqli_query($conni,"SET NAMES 'utf8'");
mysqli_query($conni,"SET CHARACTER_SET 'utf8_unicode_ci'");
mysqli_query($conni,"INSERT INTO tmp (`tm`,`user`) VALUES ('2','".date ("Y-m-d H:i:s")."');");
sleep (10);
?>
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|