4WebHelp
 FAQ  •  Search  •  User Groups  •  Forum Admins  •  Smilies List  •  Statistics  •  Rules   •  Login   •  Register
Toggle Navigation Menu

 Linking to an iframe
Post New TopicReply to Topic
View Previous Topic Print this topic View Next Topic
Author Message
goldberg_312
Junior WebHelper
Junior WebHelper


Joined: 27 May 2003
Posts: 5
Location: Florida

PostPosted: Tue May 27, 2003 1:36 pm (14 years, 5 months ago) Reply with QuoteBack to Top

Hey guys, I'm not a master of code so maybe you can help me with a predicament I'm in. I'm trying to link from a website that is not frames to a 3rd party shopping cart software which I would like to put in an iframe on a page called "cart.html" The way this is currently set up is to have a link that is coded to add the different products (www.cartwebsite.com?cartid^productinfo). Is there a way to do this?

In case I didnt explain clearly, I have 2 pages, reloadables.htm, and cart.html. cart.html has an iframe on it. I want to have a link that goes from reloadables.htm to cart.html and dynamically sets the iframe to another page.

Thanks for your time.

________________________________
-Josh
OfflineView User's ProfileFind all posts by goldberg_312Send Personal MessageAOL Instant Messenger
Daniel
Team Member



Joined: 06 Jan 2002
Posts: 2564

PostPosted: Tue May 27, 2003 4:21 pm (14 years, 5 months ago) Reply with QuoteBack to Top

PHP would be the easiest way to do it:

Code:
<?php
  echo('<iframe src="http://www.cartwebsite.com.com/?cartid='.$_GET['cartid'].'"></iframe');
?>


You'd then call this script: script.php?cartid=whatever, and it would load http://www.cartwebsite.com.com/?cartid=whatever. Or am I going off on a false track? Question

________________________________
Image
OfflineView User's ProfileFind all posts by DanielSend Personal Message
goldberg_312
Junior WebHelper
Junior WebHelper


Joined: 27 May 2003
Posts: 5
Location: Florida

PostPosted: Tue May 27, 2003 5:59 pm (14 years, 5 months ago) Reply with QuoteBack to Top

I dont know if this will affect anything, but the link I'm putting in the iframe has a "?" in it. Heres what an actual link is:

<a href=http://www.cartserver.com/sc/cart.cgi?item=a-1358^123^book^5.11^1">add to cart</a>

It's a third party software thats run from their servers, so the cart id (ie. a-1358) tells them to use my cart with my settings and to send the order to me, etc. The other info separated by the " ^ " passes along all the information needed for each item added. This link would add 1 book for $5.11 to the cart. See?

Will the php still work with this? If so please explain how I implement that because I'm not in the least bit familiar with php.

Thanks again for your help.

________________________________
-Josh
OfflineView User's ProfileFind all posts by goldberg_312Send Personal MessageAOL Instant Messenger
Daniel
Team Member



Joined: 06 Jan 2002
Posts: 2564

PostPosted: Tue May 27, 2003 6:22 pm (14 years, 5 months ago) Reply with QuoteBack to Top

Just link to script.php?item=123^book^5.11^1 and then use this code for the iframe:

Code:
<?php
  echo('<iframe src="http://www.cartserver.com/sc/cart.cgi?item=a-1358^'.$_GET['item'].'"></iframe');
?>

________________________________
Image
OfflineView User's ProfileFind all posts by DanielSend Personal Message
goldberg_312
Junior WebHelper
Junior WebHelper


Joined: 27 May 2003
Posts: 5
Location: Florida

PostPosted: Tue May 27, 2003 6:51 pm (14 years, 5 months ago) Reply with QuoteBack to Top

So I just change the name of cart.html to script.php and use that code for the iframe and it will work?

Thanks a bunch

________________________________
-Josh
OfflineView User's ProfileFind all posts by goldberg_312Send Personal MessageAOL Instant Messenger
goldberg_312
Junior WebHelper
Junior WebHelper


Joined: 27 May 2003
Posts: 5
Location: Florida

PostPosted: Tue May 27, 2003 10:13 pm (14 years, 5 months ago) Reply with QuoteBack to Top

I just used the code like you said and the iframe didnt show up on the script.php page. I copied the link you supplied into reloadables.htm and the iframe code into cart.html which i renamed script.php and when i clicked the link it opened script.php fine but didnt open the iframe. They were uploaded to the server at the time as test files. Am I missing something? Like I said, my knowledge of PHP is akin to my knowledge of the cultural diversities of Bulgaria.

Thanks yet again for your time.

________________________________
-Josh
OfflineView User's ProfileFind all posts by goldberg_312Send Personal MessageAOL Instant Messenger
Display posts from previous:      
Post New TopicReply to Topic
View Previous Topic Print this topic View Next Topic


 Jump to:   




You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot edit your posts in this forum.
You cannot delete your posts in this forum.
You cannot vote in polls in this forum.


Page generation time: 0.067148 seconds :: 17 queries executed :: All Times are GMT
Powered by phpBB 2.0 © 2001, 2002 phpBB Group :: Based on an FI Theme