BRIK Posted January 27, 2008 Share Posted January 27, 2008 It may seem like a weird thing to do so I'll give some history. I'm setting up an Amazon "astore" within an IFRAME. The capabilities are a little bit limited with this method but its all they have. The first thing I wanted to do was to be able to link to a specific item and yet maintain the page that contained the iframe. I did this Amazon provided code: <iframe src="http://astore.amazon.com/handyguys-20/ width="97%" height="1500" align="left" frameborder="0" scrolling="auto" ></iframe> My Code $queryString = $_SERVER['QUERY_STRING']; ?> <iframe src="http://astore.amazon.com/handyguys-20/detail/<?php echo $queryString ; ?>" name="hgp_store" width="97%" height="1500" align="left" frameborder="0" scrolling="auto" ></iframe> Works like a champ with one exception Once a user gets one specific item but then navigates to other items, searches, or whatever. The URL stays the same site?itemnum I would prefer if someone could bookmark specific items as they navigate (or as I create links for people). If they navigate into the shopping cart the url should say ?cart or if they were on a category the url should say site?category etc. Any thoughts how to approach? I'm no PHP expert so lease go easy. Thanks! Quote Link to comment https://forums.phpfreaks.com/topic/88104-change-main-url-based-on-iframe-url/ Share on other sites More sharing options...
BRIK Posted February 27, 2008 Author Share Posted February 27, 2008 I let this topic go for a while and its off the radar so here I am reviving it. Hope thats OK, still looking for a suggestion. To add - I would settle for the page URL to change to the generic page that holds the iframe after the user makes any click within the iframe. The problem I am trying to avoid is the now potentially confusing URL, that doesn't change, as people navigate the store. Secondarily I would prefer the URL to change as they navigate in the iframe so bookmarks are still possible. Thanks Quote Link to comment https://forums.phpfreaks.com/topic/88104-change-main-url-based-on-iframe-url/#findComment-478015 Share on other sites More sharing options...
DarkerAngel Posted February 27, 2008 Share Posted February 27, 2008 This seems like an interesting issue I'm searching for a Solution for you... Quote Link to comment https://forums.phpfreaks.com/topic/88104-change-main-url-based-on-iframe-url/#findComment-478036 Share on other sites More sharing options...
BRIK Posted February 27, 2008 Author Share Posted February 27, 2008 Thanks DarkerAngel - let me know if you need or want more information, I hope I have explained things clear enough. If it matters wordpress is my psudo CMS. Quote Link to comment https://forums.phpfreaks.com/topic/88104-change-main-url-based-on-iframe-url/#findComment-478046 Share on other sites More sharing options...
DarkerAngel Posted February 27, 2008 Share Posted February 27, 2008 Okay, the problem with this is you need to change either the <base target="_parent"> or add target="_parent" in the link, inside the iFrame, the problem is that you cannot do it to an outside URL, but what you can do to get the content of the file is cURL and within that use str_replace or a preg_replace to make sure the sources are proper (to not get any broken images / java links) thats the only alternative I can think of. Quote Link to comment https://forums.phpfreaks.com/topic/88104-change-main-url-based-on-iframe-url/#findComment-478106 Share on other sites More sharing options...
BRIK Posted February 27, 2008 Author Share Posted February 27, 2008 Wow - That was fast. Unfortunately its a bit over my head. Here is the URL http://www.handyguyspodcast.com/the-handy-guys-store If I want to post a link to a particular item I do it as follows http://www.handyguyspodcast.com/the-handy-guys-store?B000XU43IC That works great with the php code in my original post. OK - Someone follows that link but wants to continue browsing through various items in the store the URL stays the same, doesn't change. I have no control over the iframe itself, its at Amazon. So... if what you are describing in your post will get me further along maybe, if you wouldn't mind, a little nudge as to where to get started. Am I editing the same PHP as I did on my original post? I assume Yes. How so? Quote Link to comment https://forums.phpfreaks.com/topic/88104-change-main-url-based-on-iframe-url/#findComment-478117 Share on other sites More sharing options...
blurayreef Posted May 11, 2010 Share Posted May 11, 2010 Bringing this back from the grave.... But I have run into this same exact issue with my aStore. It's an iframe inside a Wordpress template, and my links in the address bar don't change when a product is clicked. BRIK, did you ever find a fix for this? Thanks. Quote Link to comment https://forums.phpfreaks.com/topic/88104-change-main-url-based-on-iframe-url/#findComment-1056780 Share on other sites More sharing options...
BRIK Posted May 11, 2010 Author Share Posted May 11, 2010 blurayreef - I have not pursued a solution. I have some other things on my plate at the moment. I have email subscribe on this topic. I would be interested in a solution. If you find one please post it. I don't have time at the moment to dig into this. Quote Link to comment https://forums.phpfreaks.com/topic/88104-change-main-url-based-on-iframe-url/#findComment-1056793 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.