sunshynecraftsbeads Posted March 23, 2017 Share Posted March 23, 2017 Hi world, I am trying to add a external link to my website but I am running into problems. My version 2.3.4 BS. I have created the page for this so customers can benefit from using this tool but I am obviously doing something wrong when I enter it.The instructions they provided me do not work. I have tried several ways with no luck. Here is the code they provided me that I need to enter to the page I made. <iframe title="Swarovski Create Your Style - Color Carousel" frameborder="0" src="http://www.create-your-style.com/Content.Node/Color-Carousel-External.en.php?utm_source=SNA&utm_medium=Widget&utm_campaign=Color-Carousel"width="642" height="1027"></iframe> '); When everything is said and done it should look like this link ; http://www.create-your-style.com/Content.Node/Color-Carousel-External.en.php If someone could help me that would be awesome and greatly appreciated. Thank you in advance. Tracie Link to comment Share on other sites More sharing options...
MrPhil Posted March 23, 2017 Share Posted March 23, 2017 Works OK for me, although you should have a space between " and width=, and make the height (and possibly width) a little larger to get rid of the scroll bars. What is that '); in your code? Is that part of some PHP code you accidentally copy-pasted in? The code you show is HTML, and cannot be dropped into PHP without wrapping something like echo ' and '; around it. Link to comment Share on other sites More sharing options...
sunshynecraftsbeads Posted March 23, 2017 Author Share Posted March 23, 2017 Hi Phil, Thanks for getting back to me. I put a space but that didn't make a difference. I have no problem making it larger but unfortunately I do not see what you are seeing (scroll bars). You asked "What is that '); in your code?" I am not sure but when I remove it I get a error message so I have left it in. The following error message; Parse error: syntax error, unexpected ''<BR><BR><P ALIGN=CENTER STYLE' (T_ENCAPSED_AND_WHITESPACE) in /home/scb2016/public_html/includes/languages/english/carousel.php on line 16 This is how I have the .php page set up. Can you tell me what I have done wrong. <?php/* $Id$ osCommerce, Open Source E-Commerce Solutions http://www.oscommerce.com Copyright © 2002 osCommerce Released under the GNU General Public License*/define('NAVBAR_TITLE', 'Color Carousel');define('HEADING_TITLE', 'New color carousel Coming Soon !!');define('TEXT_INFORMATION', '<BR><BR><P ALIGN=CENTER STYLE="margin-bottom: 0in"><iframe title="Swarovski Create Your Style - Color Carousel" frameborder="0" src="http://www.create-your-style.com/Content.Node/Color-Carousel-External.en.php?utm_source=SNA_CA_55194&utm_medium=Widget&utm_campaign=Color-Carousel"width="642" height="1027"></iframe> ');?> Thanks Phil. Tracie Link to comment Share on other sites More sharing options...
MrPhil Posted March 24, 2017 Share Posted March 24, 2017 Change define('TEXT_INFORMATION', '<BR><BR><P ALIGN=CENTER STYLE="margin-bottom: 0in"> <iframe title="Swarovski Create Your Style - Color Carousel" frameborder="0" src="http://www.create-yo...Color-Carousel"width="642" height="1027"></iframe> '); ?> to define('TEXT_INFORMATION', '<BR><BR><P ALIGN=CENTER STYLE="margin-bottom: 0in">'); ?> <iframe title="Swarovski Create Your Style - Color Carousel" frameborder="0" src="http://www.create-yo...Color-Carousel" width="642" height="1027"></iframe> You stuffed the iframe code into the middle of a PHP statement when you made the edit. I have no idea if the HTML code you inserted is now in a desirable place, but at least it should be valid code now. Link to comment Share on other sites More sharing options...
sunshynecraftsbeads Posted March 24, 2017 Author Share Posted March 24, 2017 Hi Phil, Thank you for taking the time to help me. I tried making the change exactly how you told me but I ended up getting a blank page. I will need to look into this more because I can't figure it out. It worked on a previous version but since I have updated to the 2.3.4 bs much has changed. Thanks again for helping me. Link to comment Share on other sites More sharing options...
frankl Posted March 24, 2017 Share Posted March 24, 2017 @@sunshynecraftsbeads How to add an iframe in osCommerce? Replace the content in your catalog/includes/english/carousel.php file with the following: <?php /* $Id$ osCommerce, Open Source E-Commerce Solutions http://www.oscommerce.com Copyright (c) 2002 osCommerce Released under the GNU General Public License */ define('NAVBAR_TITLE', 'Carousel'); define('HEADING_TITLE', 'Carousel'); define('TEXT_INFORMATION', '<iframe title="Swarovski Create Your Style - Color Carousel" frameborder="0" src="http://www.create-your-style.com/Content.Node/Color-Carousel-External.en.php"width="642" height="1027"></iframe>'); ?> Replace the content in your catalog/carousel.php with the following: <?php /* $Id$ osCommerce, Open Source E-Commerce Solutions http://www.oscommerce.com Copyright (c) 2010 osCommerce Released under the GNU General Public License */ require('includes/application_top.php'); require('includes/languages/' . $language . '/carousel.php'); $breadcrumb->add(NAVBAR_TITLE, tep_href_link('carousel.php')); require(DIR_WS_INCLUDES . 'template_top.php'); ?> <div class="page-header"> <h1><?php echo HEADING_TITLE; ?></h1> </div> <div class="contentContainer"> <div class="contentText"><?php echo TEXT_INFORMATION; ?> </div> <div class="buttonSet"> <div class="text-right"><?php echo tep_draw_button(IMAGE_BUTTON_CONTINUE, 'fa fa-angle-right', tep_href_link('index.php')); ?></div> </div> </div> <?php require(DIR_WS_INCLUDES . 'template_bottom.php'); require(DIR_WS_INCLUDES . 'application_bottom.php'); ?> This will work perfectly with one caveat -- if your carousel.php is a secure page (i.e. the URL starts with https:://) the content won't be displayed because modern browsers don't allow mixed content and the page you are trying to frame is insecure. You can check this by opening your console (Control + Shift + I in Chrome and Firefox) and checking the error. You will see something like Mixed Content: The page at 'https://www.example.com/carousel.php'was loaded over HTTPS, but requested an insecure resource 'http://www.create-your-style.com/Content.Node/Color-Carousel-External.en.php'. This request has been blocked; the content must be served over HTTPS. osCommerce user since 2003! Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.