u214 Posted May 5, 2011 Share Posted May 5, 2011 Hello guys, I have this images where it displays info according to your nickname. Now, let's say my current url for an image is: www.test.com/image.php?Username=TEST That would of display an image with that name. I got that part ok. Now my question is, how to make different image styles? I was thinking something like this: www.test.com/image.php?Style=2?Username=TEST "Style=2" being the second choice. My current code is like this: $_GET['Username']; // This to get the name after Username.. //How to make it different styles? //This is what I tried, but didn't worked: $istyle = $_GET['Style']; if(istyle == 1) { $username = $_GET['Username']; // Display the image with THAT style ( Style 1 ) } else if($istyle == 2) { $username = $_GET['Username']; // Display the image with the second style } ... and so on I currently have that, and this would be the url: www.test.com/image.php?Style=2?Username=TEST That works correctly, but somehow it's not catching the "Username=TEST" part, so the image does not display the name. Link to comment https://forums.phpfreaks.com/topic/235654-url-help/ Share on other sites More sharing options...
fugix Posted May 5, 2011 Share Posted May 5, 2011 yeah you could pass the info through the url, or use databases, your way works Link to comment https://forums.phpfreaks.com/topic/235654-url-help/#findComment-1211195 Share on other sites More sharing options...
spiderwell Posted May 5, 2011 Share Posted May 5, 2011 hope this is a query string typo www.test.com/image.php?Style=2?Username=TEST edit:stupid autolinker Link to comment https://forums.phpfreaks.com/topic/235654-url-help/#findComment-1211197 Share on other sites More sharing options...
fugix Posted May 5, 2011 Share Posted May 5, 2011 u214, url should be www.test.com/image.php?Style=2&Username=TEST i assume that it was just a typo Link to comment https://forums.phpfreaks.com/topic/235654-url-help/#findComment-1211199 Share on other sites More sharing options...
u214 Posted May 5, 2011 Author Share Posted May 5, 2011 Yes. Works now! Thanks y'all!! Link to comment https://forums.phpfreaks.com/topic/235654-url-help/#findComment-1211202 Share on other sites More sharing options...
fugix Posted May 5, 2011 Share Posted May 5, 2011 no problem glad we could help Link to comment https://forums.phpfreaks.com/topic/235654-url-help/#findComment-1211204 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.