Jump to content

Recommended Posts

Hi everyone,

 

I have a separate php file that's located in a specific directory and it includes another php file, ie.

 

include '../../catalogue.php';

 

The abovementioned catalogue.php file has a whole heap of links to other javascript files whose paths work in relation to the catalogue.php file, eg.

 

<script language="javascript" type="text/javascript" src="../../ScriptLibrary/jquery-latest.pack.js"></script>

<script language="javascript" type="text/javascript" src="../../dmx/dmx.core.js" id="dmxCoreJS"></script>

<script language="javascript" type="text/javascript" src="../../dmx/widgets/Lightbox/dmx.lightbox.js"></script>

 

...however, when the catalogue.php file is included from the other controller file (see the code below), the paths no longer work. Does this mean I have to change the above paths so that they are correct in relation to the controller file below?

 

Hope that makes sense and appreciate any help.

 

<?php
$link = mysqli_connect('localhost', 'root', 'root');
if (!$link)
{
$output = 'Unable to connect to the database server.';
include 'output.html.php';
exit();
}

if (!mysqli_set_charset($link, 'utf8'))
{
$output = 'Unable to set database connection encoding.';
include 'output.html.php';
exit(); 
}

if (!mysqli_select_db($link, 'catalogue'))
{
$output = 'Unable to locate the catalogue database.';
include 'output.html.php';
exit();
}

$output = 'Database connection established.';
include 'output.html.php';

$result = mysqli_query($link, 'SELECT shirtDescLadies, shirtDescMen FROM shirts');
if (!$result)
{
$error = 'Error fetching description: ' . mysqli_error($link);
include 'error.html.php';
exit();
}

while ($row = mysqli_fetch_array($result))
{
$descriptions[] = array('shirtDescLadies' => $row['shirtDescLadies'], 'shirtDescMen' => $row['shirtDescMen']);
}

include '../../catalogue.php';

?>

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.