All the dropdown php files are in the dropd directory, these are the files:
Code:
http://example.com/dropd/2c-ajax-geo.php
http://example.com/dropd/3a-index.html
http://example.com/dropd/lib/2a-config.php
http://example.com/dropd/lib/2b-lib-geo.php
http://example.com/dropd/public/3b-demo.js
http://example.com/dropd/public/3c-demo.css
I should give the right paths in these files to connect to the mysql database:
path in the file lib/2a-config.php:
Code:
// PATH
define('PATH_LIB', 'ABSOLUTE PATH HERE')
Path in the file 2c-ajax-geo.php:
Code:
// (1) INIT
require __DIR__ . DIRECTORY_SEPARATOR . "lib" . DIRECTORY_SEPARATOR . "2a-config.php";
require PATH_LIB . "2b-lib-geo.php";
The Path for the file 2c-ajax-geo.php in the file public/3b-demo.js:
Code:
xhr.open('POST', "PATH/2c-ajax-geo.php")
This is what i did but cannot connect to the database:
path in the file lib/2a-config.php:
Code:
// PATH
define('PATH_LIB', __DIR__ . '/lib');
Path in the file 2c-ajax-geo.php:
Code:
require __DIR__ . "/" . "lib" . "/" . "2a-config.php";
require "/lib/" . "2b-lib-geo.php";
The Path for the file 2c-ajax-geo.php in the file public/3b-demo.js:
Code:
xhr.open('POST', "/2c-ajax-geo.php", true);