darkfreaks Posted September 21, 2008 Share Posted September 21, 2008 ok so i am having problem with correctly linking my image i need help with why my code isnt linking correct. so i have ] <img src="<?php echo WEB_ROOT . CATEGORY_IMAGE_DIR . $cat_image; ?>"> which gives me a link like mysite.com/images/category/image.jpeg however i am currently getting a link like mysite.com/admin/cateogory/images/category/image.jpeg. i do not think this is a code issue but path issue. because this particular file is in the admin/category folder would this be causing the problem and how would i fix it ??? Link to comment https://forums.phpfreaks.com/topic/125174-image-help/ Share on other sites More sharing options...
dropfaith Posted September 21, 2008 Share Posted September 21, 2008 i generally just use ../ to go up to the root then ignore echoing the root directory just do . CATEGORY_IMAGE_DIR . $cat_image; <img src="../<?php echo WEB_ROOT . CATEGORY_IMAGE_DIR . $cat_image; ?>"> Link to comment https://forums.phpfreaks.com/topic/125174-image-help/#findComment-646988 Share on other sites More sharing options...
darkfreaks Posted September 21, 2008 Author Share Posted September 21, 2008 WEB_ROOT defines the root folder i cant remove it without it erroring and it makes no difference if i put ../ before it Link to comment https://forums.phpfreaks.com/topic/125174-image-help/#findComment-646991 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.