Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

HTML Forum


You are currently viewing our HTML Forum as a guest. Please register to participate.
Login



Post a Project »

Find a Professional HTML Freelancer!

Find a Freelancer to help you with your HTML projects

FREE Outsourcing eBook!

Reply
Linking form buttons out of iframe
Old 09-24-2008, 09:09 PM Linking form buttons out of iframe
Skilled Talker

Posts: 90
Trades: 0
Hi all,

I have a site with a login box that's set within an iframe on the main page and am trying to figure out how to have the login open into the _top or _parent frame. Normally, this wouldn't be too difficult, but the login page was developed by a different programmer (whom I can't get in touch with at this point).

Here's a dummy page that'll show you how it's set up: (rather than log in, you can just click "register")
http://www.radarrover.com/show.htm

And here is the login page's code:
Code:
<?php
    session_start();
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:v="urn:schemas-microsoft-com:vml">
<head>
    <meta http-equiv="content-type" content="text/html; charset=utf-8"/>
    <title>Scrape Data</title>
<?php
    require_once('FILE1.php');
    require_once('FILE2.php');
    require_once('FILE3.php');

    include('FILE4.php');
    create_table();
?>
</head>

<body onload="init()">

<?php
    $plans = get_plan_list();

    $action = $_REQUEST['act'];
    
    switch($action)
    {
        case 'free_register':
            register_user($_POST);
            set_payment(get_user_id($_POST['user_name']));
            daily_user_for_admin(get_user_id($_POST['user_name']));
    ?>
    <form name="loginform" action="" method="post" target="_blank">
        <div style="width:100%; text-align:center">
        <table>
            <tr>
                <td colspan="2">
                <div id="loginresult" style="background-color: #FFFFE0; border: solid 1px #E6DB55; padding: 10px 5px 10px 5px; margin-bottom:20px">
                Register Success! Please login in.
                </div>
                </td>
            </tr>
            <tr>
                <td align="left">User</td>
                <td align="left"><input type="text" name="user_name" id="user_name" onkeydown="onEnter()"></td>
            </tr>
            <tr>
                <td align="left">Password</td>
                <td align="left"><input type="password" name="pwd" id="pwd" onkeydown="onEnter()"></td>
            </tr>
            <tr>
                <td align="left"><input type="button" name="login" value="Login" onclick="onLogin()"></td>
                <td align="left"><input type="button" name="register" value="Register" onclick="javascript:document.location.href='paypal/register.php';"></td>
            </tr>
            <tr>
                <td colspan="2" align="left"><a href="?lostpassword=true" onclick="">Lost your password?</a></td>
            </tr>
        </table>
        </div>
    </form>
    <?php

            break;
        case 'logout':
            $_SESSION['user_name'] = '';
            $_SESSION['user_id'] = '';
            session_unset();
    ?>
    <form name="loginform" action="" method="post" target="_top">
        <div style="width:100%; text-align:center">
        <table>
            <tr>
                <td colspan="2">
                <div id="loginresult" style="background-color: #FFFFE0; border: solid 1px #E6DB55; padding: 10px 5px 10px 5px; margin-bottom:20px">
                <?php
                    if ($_GET['register'] == md5('success'))
                    {
                        echo "Register Success";
                    }
                ?>
                Please login in
                </div>
                </td>
            </tr>
            <tr>
                <td align="left">User</td>
                <td align="left"><input type="text" name="user_name" id="user_name" onkeydown="onEnter()"></td>
            </tr>
            <tr>
                <td align="left">Password</td>
                <td align="left"><input type="password" name="pwd" id="pwd" onkeydown="onEnter()"></td>
            </tr>
            <tr>
                <td align="left"><input type="button" name="login" value="Login" onclick="onLogin()"></td>
                <td align="left"><input type="button" name="register" value="Register" onclick="javascript:document.location.href='paypal/register.php';"></td>
            </tr>
            <tr>
                <td colspan="2" align="left"><a href="?lostpassword=true" onclick="">Lost your password?</a></td>
            </tr>
        </table>
        </div>
    </form>
<?php
            break;
        case 'lostpassword':
?>
    <form name="loginform" action="" method="post" target="_top">
        <div style="width:100%; text-align:center">
        <table>
            <tr>
                <td colspan="2">
                    <div style="background-color: #FFFFE0; border: solid 1px #E6DB55; padding: 10px 5px 10px 5px; margin-bottom:20px" id="lostpasswordresult">
                    Please enter your e-mail address. <br>
                    You will receive a new password via e-mail.
                    </div>
                </td>
            </tr>
            <tr>
                <td align="left">Your Email Address</td>
                <td align="left"><input type="text" name="user_name" id="user_name"></td>
            </tr>
            <tr>
                <td align="left" colspan="2">
                <input type="button" name="getpassword" value="Get New Password" onclick="onNewPassword()">
                &nbsp;&nbsp;&nbsp;<a href="?" onclick="">Log in</a></td>
            </tr>
        </table>
        </div>
    </form>
<?php
            break;
        default:
?>
    <form name="loginform" action="" method="post" target="_top">
        <div style="width:100%; text-align:center">
        <table>
            <tr>
                <td colspan="2">
                <div id="loginresult" style="background-color: #FFFFE0; border: solid 1px #E6DB55; padding: 10px 5px 10px 5px; margin-bottom:20px">
                <?php
                    if ($_GET['register'] == md5('success'))
                    {
                        echo "Register Success";
                    }
                ?>
                Please login in
                </div>

                </td>
            </tr>
            <tr>
                <td align="left">User</td>
                <td align="left"><input type="text" name="user_name" id="user_name" onkeydown="onEnter()"></td>
            </tr>
            <tr>
                <td align="left">Password</td>
                <td align="left"><input type="password" name="pwd" id="pwd" onkeydown="onEnter()"></td>
            </tr>
            <tr>
                <td align="left"><input type="button" name="login" value="Login" onclick="onLogin()"></td>
                <td align="left"><input type="button" name="register" value="Register" onclick="javascript:document.location.href='paypal/register.php';"></td>
            </tr>
            <tr>
                <td colspan="2" align="left"><a href="?act=lostpassword" onclick="">forgot my password?</a></td>
            </tr>
        </table>
        </div>
    </form>
<?php
            break;
    }
?>
</body>

</html>
I tried adding in the target="_top" portions already, changing the targets to _blank, _parent, etc. and nothing works.

Thanks in advance for any help!
msaz87 is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 11-24-2008, 04:40 AM Re: Linking form buttons out of iframe
Experienced Talker

Posts: 48
Name: Pieter
Location: Holland
Trades: 0
I think you cant possebly do this, because an iframe shows an entireley different page inside itself. So it onley show's the page, but there is no conecction.
elcosmo is offline
Reply With Quote
View Public Profile
 
Old 12-03-2008, 10:07 AM Re: Linking form buttons out of iframe
Experienced Talker

Posts: 48
Name: Pieter
Location: Holland
Trades: 0
I found it

the javascript:
HTML Code:
<script type="text/javascript">
function outpage()
{
if (window.top!=window.self) 
  {
  window.top.location="domain.com";
  }
}
</script>
what you should put in the link:
HTML Code:
onclick="outpage()"
hope it helps
elcosmo is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to Linking form buttons out of iframe
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.70929 seconds with 12 queries