jvan1768 Posted March 4, 2008 Share Posted March 4, 2008 I am trying to figure out how to rotate an image in a div based on the current url the user is at. I am using this in Zen-cart and want to rotate the header image, but the php for the header section is the same for every page. I want to be able to display a different header image for each of the different shopping categories. Any ideas? Let me know if you need me to clarify the problem. Link to comment https://forums.phpfreaks.com/topic/94311-rotating-a-div-image-based-on-page-url/ Share on other sites More sharing options...
craygo Posted March 4, 2008 Share Posted March 4, 2008 use the gd library to rotate the picture <?php $image = "url/to/image.jpg"; $source = imagecreatefromjpeg($image); $rotate = imagerotate($source, 90, 0); imagejpeg($rotate); ?> Ray Link to comment https://forums.phpfreaks.com/topic/94311-rotating-a-div-image-based-on-page-url/#findComment-483017 Share on other sites More sharing options...
jvan1768 Posted March 4, 2008 Author Share Posted March 4, 2008 I'm sorry what is the gd library? I am not too familiar with php. Also to clarify, I want the php to select the appropriate image based on the current URL. The header php doesn't change throughout the site but I want the image that is there to change based on the URL thanks Link to comment https://forums.phpfreaks.com/topic/94311-rotating-a-div-image-based-on-page-url/#findComment-483023 Share on other sites More sharing options...
craygo Posted March 4, 2008 Share Posted March 4, 2008 Well what is the url going to look like. Obviously the page doesn't have the image on it so where will the images be??? Some examples would be nice. Link to comment https://forums.phpfreaks.com/topic/94311-rotating-a-div-image-based-on-page-url/#findComment-483044 Share on other sites More sharing options...
jvan1768 Posted March 4, 2008 Author Share Posted March 4, 2008 This for an online store using Zen-cart. The url is going to be the location of a certain product. Example: index.php?main_page=index&cPath=65_48 --> is the specific url of the product category Now according to the specific product url, I want to be able to rotate the image that is displayed in the header whose php is the same across the entire site. The images will be house in a central image folder and would be called into the header based on the current url. Does this make more sense Link to comment https://forums.phpfreaks.com/topic/94311-rotating-a-div-image-based-on-page-url/#findComment-483076 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.