Produces php5.6 compatible code, but in line with looking to upgrade the code base to php8x include getq.php or qetq2.php or getq3.php bring in various functions: the locations / Purpose of getq's getq.php Location: include ("../../operainfo/getq.php"); requires to be logged in to work , or it kicks the user out to google, setup some global variables for quick access in any of the system . and php functions that are used through out the system such as safetext2() will includes code to include the Header.php file which in turn loads the menu.php file, has full html output, getq2.php Location: include ("../../operainfo/getq2.php"); setup some global variables for quick access in any of the system . and php functions that are used through out the system such as safetext2() does not produce any html or output, so can be used inside PDF generators / AJAX Links for raw data, getq3.php Location: include ("../../operainfo/getq3.php"); includes getq2.php and includes a slim header bar header3.php, does not kick user out, cannot be used for PDF Generators or AJAX links. Such as function sqlquery($getq) { $server="localhost"; $username="viamed"; $serverpassword="xxx"; $db="viamed"; $conn = new mysqli($server, $username, $serverpassword, $db); if ($conn->connect_error) { die("Connection failed: " . $conn->connect_error); } $result = $conn->query($getq); $conn->close(); return $result; } and function getquery ($getq) { $server="localhost"; $username="viamed"; $serverpassword="xxxx"; $db="viamed"; $link = mysql_connect($server,$username,$serverpassword); if (! $link) die("Couldn't connect to MySQL"); mysql_select_db($db , $link) or die("Couldn't open $db: ".mysql_error()); $res = mysql_query($getq) or die("SELECT Error: ".mysql_error()."
".$getq); mysql_close($link); return $res; } getquery() takes an SQL statement and passes it through, was to be replaced by sqlquery() for when mysql commands were depreciated. any new code should at least use sqlquery instead of getquery, where ever you see Replacing include ("../../operainfo/linkget.php") this can be replace with it passes regular argument to the URL which are now all contained in a global variable $x When updating things like : $vui=safetext2($_GET[vui]); Do NOT use: $vui = safetext2($_GET['vui'] ?? ''); as ?? is not php5.6 compatible, use something like: $vui = safetext2(isset($_GET['vui']) ? $_GET['vui'] : '');: do not show the explainations after the code update dont use you memory to mix up different chats the code produced must be compatible with php5.6 and php8x and confirmed it will work on both systems, where possible add inside php code note to anyone that reads the source, it has been checked for php 8 and 5.6 compatibility