limitphp Posted August 1, 2012 Share Posted August 1, 2012 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\ Quote Link to comment https://forums.phpfreaks.com/topic/266562-links-and-images-not-pointing-to-correct-path/ Share on other sites More sharing options...
Jessica Posted August 1, 2012 Share Posted August 1, 2012 What do you expect when $folder = ""; Quote Link to comment https://forums.phpfreaks.com/topic/266562-links-and-images-not-pointing-to-correct-path/#findComment-1366080 Share on other sites More sharing options...
limitphp Posted August 1, 2012 Author Share Posted August 1, 2012 oh my goodness, I'm a fool. I'm sorry....thank you. I haven't been getting alot of sleep lately and my mind is nowhere near 100%. Thanks again. Quote Link to comment https://forums.phpfreaks.com/topic/266562-links-and-images-not-pointing-to-correct-path/#findComment-1366135 Share on other sites More sharing options...
limitphp Posted August 1, 2012 Author Share Posted August 1, 2012 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. Quote Link to comment https://forums.phpfreaks.com/topic/266562-links-and-images-not-pointing-to-correct-path/#findComment-1366137 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.