TCH-Thomas Posted May 23, 2005 Posted May 23, 2005 I use simple machines forum on a site (some of you know knows which forum I mean ). On this site I have placed a ssi script for a log in box. When a user have filled out their userinfo and click log in I want the forum to open in a new window or on top of the existing one. I brought this up in the SMF forum, but I was told that the ssi.php was not designed to work in an iframe. The actual ssi.php is a large file but below is what I think is the appropriate part of it. If anyone would like to have a look at it and tell me if it would work to have the forum open as I want it, I would be very happy. I´m not sure why, but I refuse to believe (until proven wrong) that it would not work, since SMF would as far as I understand loose alot of customers if their stuff can´t be used in frames or iframes. Here are the codes I use: SSI.php >// Shows a login box. function ssi_login($redirect_to = '', $output_method = 'echo') { global $scripturl, $txt, $user_info; if ($redirect_to != '') $_SESSION['login_url'] = $redirect_to; if ($output_method != 'echo' || !$user_info['is_guest']) return $user_info['is_guest']; echo ' <form action="', $scripturl, '?action=login2" method="post"> <table border="0" cellspacing="1" cellpadding="0" class="ssi_table"> <tr> <td align="right"><label for="user">', $txt[35], ':</label> </td> <td><input type="text" id="user" name="user" size="9" value="', $user_info['username'], '" /></td> </tr><tr> <td align="right"><label for="passwrd">', $txt[36], ':</label> </td> <td><input type="password" name="passwrd" id="passwrd" size="9" /></td> </tr><tr> <td><input type="hidden" name="cookielength" value="-1" /></td> <td><input type="submit" value="', $txt[34], '" /></td> </tr> </table> </form>'; } The code I use inside the iframe ><style type="text/css"> <!-- .ssi_table { font-family: verdana, arial, helvetica, sans-serif; font-size: 10pt; } --> </style> <?php include('http://www.marveassistans.se/forum/SSI.php?ssi_function=login'); ?> Quote
Pendragon Posted May 24, 2005 Posted May 24, 2005 <form action="', $scripturl, '?action=login2" method="post"> I think you can use target="my_newwindow"' in the form line. Quote
TCH-Thomas Posted May 24, 2005 Author Posted May 24, 2005 Thanks Pendragon, it works great. I figured it was something like target="my_newwindow"' that should be put somewhere in that code, but I didn´t know where and since the SMF guys told me it wouldn´t work, I got really insecure about it. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.