0

I am having a problem defining these constants on my localhost:

define ('BASE_URI','C:\wamp\www\shop\\');
define ('BASE_URL','http://localhost/shop/htdocs/');
define ('MYSQL','BASE_URI/.mysql.inc.php');

How exactly do I define BASE_URL, and BASE_URL using wamp which is located i the C directory.

This gives me an 500 Internal Server Error.

Regards, Klemme

Edited by klemme: n/a

2
Contributors
3
Replies
7
Views
5 Years
Discussion Span
Last Post by klemme
0

I still get an error though, but now 404 not found - so i guess i have improved it..

My directory structure is like this:

Outside the web root directory is my mysql.inc.php:

// Database constants definition:
define ('DB_HOST','localhost');
define ('DB_USER','root');
define ('DB_PASSWORD','');
define ('DB_NAME','shop');

// Oprettelse af forbindelse:
$dbc = mysqli_connect(DB_HOST,DB_USER,DB_PASSWORD,DB_NAME);

// Definer carachter set:
mysqli_set_charset($dbc, 'utf8');

And then the site is inside a directory called htdocs.
Inside htdocs I have the following directory structure: only showing a few

-> includes (inside this I have a file called config.inc.php - which looks like this)
And this is where I want to create the constants:

define ('BASE_URI',''.$_SERVER['DOCUMENT_ROOT'].'');
define ('BASE_URL','http://localhost/shop/htdocs/');
define ('MYSQL',BASE_URI.'mysql.inc.php');

And then in my index.php file, i want to include the config.inc.php - and establish the db connection, but i am screwing it up:

index.php:

<?php require('./includes/config.inc.php'); ?>
<?php require(MYSQL); ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
</head>

<body>
</body>
</html>

Edited by klemme: n/a

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.