Jump to content

Recommended Posts

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!

Link to comment
https://forums.phpfreaks.com/topic/88104-change-main-url-based-on-iframe-url/
Share on other sites

  • 5 weeks later...

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

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.

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?

  • 2 years later...

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.

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.