Page 1 of 2 12 LastLast
Results 1 to 10 of 20
  1. #1
    Join Date
    Oct 2006
    Posts
    149
    Plugin Contributions
    0

    Default iFrame - Forbidden error

    Hi everybody,

    I have created a custom page, which contains another zen page in its iframe:

    the fragment of the custom page:

    <iframe width="100%" scrolling="no" frameborder="0" src="includes/templates/template_default/templates/tpl_page_3_default.php" ></iframe>

    The problem is that the iframe cannot open the page and generates a forbidden error: You don't have permission to access /includes/templates/template_default/templates/tpl_page_3_default.php

    I cannot figure out what makes this restriction. Please, help

    Thanks

    Andy

  2. #2
    Join Date
    Mar 2004
    Posts
    16,042
    Plugin Contributions
    5

    Default Re: iFrame - Forbidden error

    the issue is you are trying to call this outside ZC,

    why are you trying to insert zc in an iframe,
    Zen cart PCI compliant Hosting

  3. #3
    Join Date
    Oct 2006
    Posts
    149
    Plugin Contributions
    0

    Default Re: iFrame - Forbidden error

    I have fixed the FORBIDDEN error by changing the .htaccess file, but still cannot figure out what is the root page file for zc to call within an iframe.

    Obviously, the iframe should contain the includes/application_top.php file

    The reason why i need iframe is simple: I have to pass POST (or GET) variables to the truncated zc product page (only the page - no sidebar and the headers). I do not see any other ways how to do this.

    What I need is to open the product category page within the iframe, while I assign the product IDs from my custom page containing the iframe.

    What is the correct way of doing this?

  4. #4
    Join Date
    Jan 2004
    Posts
    66,446
    Plugin Contributions
    81

    Default Re: iFrame - Forbidden error

    Well, Zen Cart isn't designed to operate from within an iframe.

    The root file to call for Zen Cart is /index.php

    Attempting to access any *.php file under the /includes folder directly from a browser will result in the 403-forbidden error (due to the .htaccess directives).


    You've decided that using an iframe is a solution to some particular problem you're trying to solve, or business need you're trying to meet. What is the root need/problem? Perhaps an iframe may not be the "best" solution, and perhaps we can offer some other ideas ...
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

  5. #5
    Join Date
    Oct 2006
    Posts
    149
    Plugin Contributions
    0

    Default Re: iFrame - Forbidden error

    The reason why I need the iframe structure is as follows:

    1) I need to incorporate a Google API map on my custom page, while the markers are linked to the zc products and categories

    2) when the user clicks on the "marker details" on the map, the linked product/category should open below the map

    3) I cannot redraw the map - it has to stay untill another set of markers need to be displayed

    I would appreciate, if you suggest a better solution than iframes, but so far i could not find anything else to make it work. Right now I have finished the mapping application, it opens on a custom pages with all the coorrect markers linked to products. Next, I need a link from the marker - like index.php?main_page=index&cPath=66 to open the assosiated product category below the map.

    In other words, I need the product category page to open alone without zc sideboxes and headers.

    I would appreciate your help.

    Thanks

    Andy

  6. #6
    Join Date
    Jan 2004
    Posts
    66,446
    Plugin Contributions
    81

    Default Re: iFrame - Forbidden error

    Here's one method you could try ... keeping your existing iframe approach:

    1. set all your GM url's to have another parameter on them, such as: &dmode=inline
    ie: index.php?main_page=index&cPath=66&dmode=inline

    2. edit your custom template's tpl_main_page.php file:
    Find this section:
    Code:
    // the following IF statement can be duplicated/modified as needed to set additional flags
      if (in_array($current_page_base,explode(",",'list_pages_to_skip_all_right_sideboxes_on_here,separated_by_commas,and_no_spaces')) ) {
        $flag_disable_right = true;
      }
    Add this below it:
    Code:
      if (isset($_GET['dmode']) && $_GET['dmode'] == 'inline') {
        $flag_disable_left = true;
        $flag_disable_right = true;
        $flag_disable_header = true;
        $flag_disable_footer = true;
      }

    That'll cause only the links generated from the map to display without any header, footer, left, or right sidebox data.
    Last edited by DrByte; 5 Apr 2007 at 06:33 AM. Reason: changed from "mode" to "dmode" just in case of clashes
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

  7. #7
    Join Date
    Oct 2006
    Posts
    149
    Plugin Contributions
    0

    Default Re: iFrame - Forbidden error

    Thank you, I will try this. What is the correct link to place within an iframe? Should it be like:

    <iframe .... src="index.php?main_page=index&cPath=66&dmode=inline"...></iframe>?

    or could I reference it directly to the template file?

  8. #8
    Join Date
    Jan 2004
    Posts
    66,446
    Plugin Contributions
    81

    Default Re: iFrame - Forbidden error

    Step back a second ....

    Zen Cart's infrastructure auto-selects which template to use based on the URL parameters.
    It starts from index.php
    In the case of the URL you're proposing: index.php?main_page=index&cPath=66
    ...
    main_page=index tells it to use tpl_index_default
    but, since cPath is specified, it flips over to using either tpl_index_product_list.php or tpl_index_categories.php and a few others such as tpl_modules_category_row.php and so on.

    But, before that even happens, all pages start from tpl_main_page.php, which builds header, left-sideboxes, then main content from the page template (just mentioned above), then right-sideboxes, then footer.

    By adding the code suggested earlier, the dmode=inline switch will cause tpl_main_page to "only" display the content for the category number 66.

    Thus, you don't need to reference a specific template/template-file. You just use the URL.

    As for what to put in the iframe SRC parameter, I suspect that the URL you mentioned in your last post will be fine. It's likely wise to use the complete URL, including http: //domain_name etc...
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

  9. #9
    Join Date
    Oct 2006
    Posts
    149
    Plugin Contributions
    0

    Default Re: iFrame - Forbidden error

    DrByte, Thanks you for the great solution, which saved a lot of my time! Highly appreciated! A few questions regarding that iframe structure:

    1) now i have to add "&mode=inline" to all the links from products/categories listied within the iframe. Is there a some shortcut rather than finding all the instances of the 'products_id=' in <a href> links?

    2) how can I pass session variables from the main zc body to the iframe? Calling the system SESSION vars from within the iframe does not work. Should I specify some specific session name? By default, session from the iframe refer to the PHPSESSID.

    Thanks again for your help

    Andy

  10. #10
    Join Date
    Jan 2004
    Posts
    66,446
    Plugin Contributions
    81

    Default Re: iFrame - Forbidden error

    Now you're making it a whole lot more complex.

    Again, Zen Cart isn't designed to operate within an iframe, especially since there are session implications etc.

    What exactly are visitors supposed to do after clicking on a link in your map? You mentioned that that's supposed to bring up a list of categories below the map. Then what? And after that, what? And again after that, what? ... and ... and ... then what?

    And ... what about regular navigation things on the normal sideboxes?

    I was of the impression that the iframe was *inside* other Zen Cart pages. Is that still correct? What interaction is supposed to take place between inner and outer sections?


    (I think you're going to need to get a lot more familiar with the inner workings of PHP and Zen Cart if you want to make the rest of that work.)
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

 

 
Page 1 of 2 12 LastLast

Similar Threads

  1. Help me. Error 403. Forbidden Error
    By thelostknight in forum Installing on a Linux/Unix Server
    Replies: 1
    Last Post: 4 Jun 2011, 04:15 AM
  2. Forbidden error
    By CDTroyes in forum General Questions
    Replies: 2
    Last Post: 20 Feb 2011, 09:53 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg