Jump to content

Links and images not pointing to correct path


limitphp

Recommended Posts

Ok, my index page loads up, but the images don't work and none of the links work. 

 

example) link points to http://localhost/register.php

 

but it should point to http://localhost/Greckle/register.php

 

the folder name is not being included in my links.

 

here is the code I have that should be taking care of that  its in a file called inc_set_root.php:

 

<?php
$path_set = "/";
$folder = ""; // set this to be "/folder" if the script is included in a folder
define("DOC_ROOT", $_SERVER['DOCUMENT_ROOT'] . $folder);
define("SITEURL", "http://" . $_SERVER['HTTP_HOST'] . "/" . $folder);
?>

 

 

in the index file I call this file using this code:

 

<?php 
session_start();
include("inc_set_root.php");
include("inc_connGreckle.php");
include("inc_global_functions.php");
include("inc_login_script.php");

 

that is the beginning of my index file.   

 

the site is in C:wamp\www\Greckle\

ok, I just set folder to "Greckle"; so now that piece of code looks like this:

 

<?php
$path_set = "/";
$folder = "Greckle"; // set this to be "/folder" if the script is included in a folder
define("DOC_ROOT", $_SERVER['DOCUMENT_ROOT'] . $folder);
define("SITEURL", "http://" . $_SERVER['HTTP_HOST'] . "/" . $folder);
?>

 

I exited wamp and restarted.  And the links still don't have the folder.  They still are like this:

 

http://localhost/register.php

 

instead of this: http://localhost/Greckle/register.php

 

 

ONEDIT:

 

nevermind....I just changed to:

 

$folder = "Greckle/";

 

the foward slash fixed it.  thanks again.

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.