Announcement

Collapse
No announcement yet.

close iFrame with sc_redir ??

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • close iFrame with sc_redir ??

    Hello,
    I call a SC form in an iFrame of another application.
    That's no problem.

    Now I want SC ti leave the Iframe and open a new (not SC) web-Page.
    I tried :

    sc_redir ("http://k222.ims-firmen.de/SVSS_FITH/Web_Builder/xxx.html","","_parent");

    But the new site is opened again within the iFrame..

    is it possible ??

    Best regards
    Uwe

  • #2
    If it's not a problem to open a new tab then you could use _blank
    Albert Drent
    aducom software netherlands
    scriptcase partner, reseller, support and (turn-key) development
    www.scriptcase.eu / www.scriptcase.nl

    Comment


    • #3
      I know this is an old thread to resurrect, but it's a pain when Google links to unanswered questions. The target of "_parent" should be "_top" if you want to replace the whole page.

      Comment


      • #4
        Close iFrame with redir_target

        Originally posted by aducom View Post
        If it's not a problem to open a new tab then you could use _blank
        Hi I've tried _blank but it still opens inside the iFrame??

        It's a menu app, and the default page is a login page.
        When the user login I wan't the app to load a new menu app with another default page??

        Below is the onValidateSucces code from the login page:

        $dir = opendir($this->Ini->path_aplicacao . "..");

        while ($file = readdir($dir))
        {
        if ($file != '.' && $file != '..' && $file != '_lib')
        {
        sc_apl_status($file, 'on');
        }
        }

        closedir($dir);

        if(sc_logged({login})):
        sc_log_add('login', {lang_login_ok});
        sc_user_logout('logged_user', 'logout', 'secapp_Login');
        // Redirection parameters
        // $redir_param = array( // Param list, add as many as needed
        // "email" => "{email}",
        // "param_2" => "value_2"
        // );
        // $redir_param = json_encode($redir_param);
        // Redirection
        $redir_app = "http://127.0.0.1:88/scriptcase/app/wmqmsproject/wmqms_menu"; // Application name
        $redir_target = "_blank"; // Target window (_blank, _self, _parent or modal)
        sc_redir($redir_app, $redir_target);
        endif;

        Thanks in advance

        Michael

        Comment


        • #5
          _blank should open a new tab, but perhaps there's a browser issue. If you omit the parameter it is generated within the IFrame, if you set _parent you can remove the container iframe.
          Albert Drent
          aducom software netherlands
          scriptcase partner, reseller, support and (turn-key) development
          www.scriptcase.eu / www.scriptcase.nl

          Comment


          • #6
            Hi All, this is my first post and I joined the forum specifically because I had this same exact issue. After much experimention, I found that to make this work, you have to provide a second parameter to the macro. but since the parameter is blank, it'll look like this:

            sc_redir(verify.php, "", _parent);

            this got it to exit the iFrame in my project. Using sc_redir(verify.php, _parent); keeps it in the iFrame, I'm guessing because the macro is looking for that additional parameter before it'll respond to the third.


            Hope this works for your guys as well.

            ~Joe

            Comment

            Working...
            X