0
<?php
//Note: This file should be included first in every php page.
error_reporting(E_ALL);
ini_set('display_errors', 'On');
define('BASE_PATH', dirname(dirname(__FILE__)));
define('APP_FOLDER', 'simpleadmin');
define('CURRENT_PAGE', basename($_SERVER['REQUEST_URI']));

/* PATH OF SAVED QR CODES */
define('PATH', './saved_qrcode/'); //You can change the folder where the qr code will be saved
define('DIRECTORY', BASE_PATH.'/saved_qrcode/');

//You can change the page name for the redirect and the search parameter (the default is "id")
define('READ_PATH', $_SERVER['HTTP_HOST'].'/read.php?id=');  

require_once BASE_PATH . '/lib/MysqliDb/MysqliDb.php';
require_once BASE_PATH . '/helpers/helpers.php';

/*
|--------------------------------------------------------------------------
| DATABASE CONFIGURATION 
|--------------------------------------------------------------------------
 */

define('DB_HOST', "s");
define('DB_USER', "");
define('DB_PASSWORD', "");  // There are defined
define('DB_NAME', "");

/**
 * Get instance of DB object
 */
function getDbInstance() {
    return new MysqliDb(DB_HOST, DB_USER, DB_PASSWORD, DB_NAME);
}

PHP Notice: Undefined index: REQUEST_URI in C:\Users\Dell\AppData\Local\Temp\fz3temp-2\config.php on line 8

Notice: Undefined index: REQUEST_URI in C:\Users\Dell\AppData\Local\Temp\fz3temp-2\config.php on line 8

Notice: Undefined index: HTTP_HOST in C:\Users\Dell\AppData\Local\Temp\fz3temp-2\config.php on line 15 PHP Notice: Undefined index: HTTP_HOST in C:\Users\Dell\AppData\Local\Temp\fz3temp-2\config.php on line 15 PHP Warning: require_once(C:\Users\Dell\AppData\Local\Temp/lib/MysqliDb/MysqliDb.php): failed to open stream: No such file or directory in C:\Users\Dell\AppData\Local\Temp\fz3temp-2\config.php on line 19

Warning: require_once(C:\Users\Dell\AppData\Local\Temp/lib/MysqliDb/MysqliDb.php): failed to open stream: No such file or directory in C:\Users\Dell\AppData\Local\Temp\fz3temp-2\config.php on line 19

M. Eriksson
  • 13,450
  • 4
  • 29
  • 40
Andrew
  • 3
  • 2
  • None of those messages are fatal errors. They're all notices or warnings. – ADyson Dec 25 '21 at 18:34
  • https://github.com/giandonatoinverso/PHP-Dynamic-Qr-code I got the codes from here. I installed it but it doesn't work properly and I don't have enough code knowledge to fix it. Can you help me? Can you try to download and install it? – Andrew Dec 25 '21 at 18:35
  • 1
    `Warning: require_once` would be followed by a fatal error on the same line (requiring a file that's not found terminates the script). So @Andrew, does this file exist? `C:\Users\Dell\AppData\Local\Temp/lib/MysqliDb/MysqliDb.php`? – Markus AO Dec 25 '21 at 18:37
  • Follow the guidance in the duplicate to learn why these types of error commonly occur, and how to diagnose and fix them. Then you'll start to gain the necessary skills and knowledge. – ADyson Dec 25 '21 at 18:38
  • I did most of it and spent about 2 days. Now the only problem is that when you scan the qr, it doesn't open the url. These are simple mistakes, but I'm studying mechanical engineering and I don't know coding. please help me with this? @ADyson – Andrew Dec 25 '21 at 18:51
  • @MarkusAO No. I didnt find this AppData\Local\Temp/ . ::(.... – Andrew Dec 25 '21 at 18:57
  • 1
    Well the file is there in the repo under lib/MysqliDb. Make sure you have installed and are using it correctly. Most likely you're including the file from a location that messes up with the dynamic `BASE_PATH` mapping found above. By the looks of it, it should be included from the application root directory, to reach: `BASE_PATH . '/lib/MysqliDb/MysqliDb.php';`. – Markus AO Dec 25 '21 at 19:04
  • Regarding the `Undefined index: REQUEST_URI` and `Undefined index: HTTP_HOST`...are you by any chance running the php script from a command line, instead of via a web request? From a quick Google, that's by far the most likely reason for those variables to be missing. https://www.google.com/search?q=Undefined+index%3A+REQUEST_URI – ADyson Dec 25 '21 at 19:27
  • i failed @MarkusAO – Andrew Dec 25 '21 at 20:19
  • 1
    "Failure is not an option." (Nor is free remote support?!) Update your post with 1. you have verified that all files are in place, 2. how (browser or CLI) & calling what file you use to access the application, and also 3. have your codes under a coherent path, ie. now you have a script at `\Temp\fz3temp-2\config.php` giving errors, and trying to access something in `\Temp/lib/`, etc. that will mess up your basepath. – Markus AO Dec 25 '21 at 20:25
  • Okay I did the setup with Free domain and hosting as specified by the manufacturer. Everything is ok until step 3. Now I found the problem, when I open filezilla, it creates such a path. C:\Users\Dell\AppData\Local\Temp/lib/MysqliDb/MysqliDb.php @MarkusAO – Andrew Dec 25 '21 at 21:40

0 Answers0