Solved

iframe in ie cut off in php  and html pages

Posted on 2006-06-20
4
697 Views
Last Modified: 2012-05-05
view the problem here http://koamrealty.com/eng_pages/eng_business.shtml

iframe is cut off in IE only. Looks great in firefox and opera. Another issue is we dont' want scrolling but want the html page to automatically extend down i.e. expand the table cell. Thanks.

Code is:
html page
<iframe src="../koam_bb_kor/board.php?Language=KOR&DB_Name=BUS" width="549" frameborder="0" marginheight="1px" marginwidth="1px" scrolling="no" height="706"></iframe>

php page
<head>
<link rel="stylesheet" type="text/css" href="../Koam_style.css">
<script language="JavaScript">
 function resize() {
  var iframe = document.all.stretch;
   iframe.height=document.frames("stretch").document.body.scrollHeight;
  }
</script>

<script type="text/javascript">
<!--
function popup(mylink, windowname)
{
      if (! window.focus)return true;
      var href;
      if(typeof(mylink) == 'string')
            href=mylink;
      else
            href=mylink.href;
      window.open(href, windowname, 'width=400, height=200, scrollbars=no');
      return false;
}
//-->
</script>
</head>
<body link="#000000" vlink="#000000" alink="#000000">
<div class="bb_text">
<?php
      $Language = $_GET["Language"];
      $DB_Name = $_GET["DB_Name"];
      $Table = $Language . _ . $DB_Name;

      if (is_Null($Language)){
            $Table = ENG_BUS;
            $Language = ENG;
            $DB_Name = BUS;
      }

      if (is_Null($DB_Name)){
            $Table = ENG_BUS;
            $DB_Name = BUS;
            $Language = ENG;
      }

      $TableRepl = $Table . _ . "Reply";


      $link = mysql_connect('localhost','schoi', 'KoamAdmin');

      if(!$link){
            die('Could not connect: ' . mysql_error());
      }

      mysql_select_db("Koam_DB") or die ('Could not select database');
?>
      <table align = "left" valign="top" border = "0" width = "549" cellspacing = "1" cellpadding = "0">
            <tr bgcolor = #333333 height = 19>
                  <!--/* <b><td align = "center" valign = "middle" width = 110><span class="body_text"><font color = #ffffff> DATE </font></span></td></b> */ -->
                  <b><td align = "center" valign = "middle" width = 375><span class="body_text"><font color = #ffffff> TITLE </font></span></td></b>
                  <b><td align = "center" valign = "middle" width = 64><span class="body_text"><font color = #ffffff>REPLIES </font></span></td></b>
            </tr>
<?php
      $SearchThis = $_GET["SearchThis"];
      $SearchBy = $_GET["SearchBy"];
      $ColorVar = 1;
      $ShowEntry = $_GET["Entry"];
      $ShowReply = $_GET["Reply"];

      if(!is_null($SearchThis)){
            $query = "SELECT * FROM $Table WHERE $SearchBy LIKE \"%$SearchThis%\" ORDER BY Entry_ID DESC;";
      }
      else{
            $query = "SELECT * FROM $Table ORDER BY Entry_ID DESC;";
      }

      if(is_null($ShowEntry)){
            $ShowEntry = 0;
      }

      if(is_null($ShowReply)){
            $ShowReply = false;
      }

      $Entries = mysql_query($query) or die('Query failed: ' . mysql_error());

      $NumRows = mysql_num_rows($Entries);

      while($line = mysql_fetch_array($Entries, MYSQL_ASSOC)){
            $ColorVar = $ColorVar + 1;
            $Color = ACACAC;
            $EntryID = $line["Entry_ID"];

            if($ColorVar % 2 == 0){
                  $Color = ACACAC;
            }else{
                  $Color = CCCCCC;
            }

            echo "\t\t<tr bgcolor = #$Color align = \"center\" height = 19 colspan=2 class=\"body_text\"><b>\n";
            /* echo "\t\t\t<td><font color=\"#000000\">";

            echo date("m.d.Y", strtotime($line["Created_DT"]));

            echo "</font></td>\n"; */

            echo "\t\t\t<td align=\"left\">";
                                           echo "<table align = \"left\" valign=\"top\" border = 0 width = 355 cellspacing = 0 cellpadding = 0>";
                                           echo "<tr bgcolor=#$Color height=19 class=\"body_text\">";
                                           echo "<td><font color=\"#000000\">";
            echo "<a style=\"text-decoration:none\" href = \"board.php?Entry=$EntryID&Language=$Language&DB_Name=$DB_Name\">";
            echo $line["Title"];
            echo "</a></td></tr></table>";
                                           echo "</td>\n";

            echo "\t\t\t<td align = \"center\"><font color=\"#000000\">";
            $Replies = mysql_query("SELECT COUNT(*) AS NumReplies FROM $TableRepl WHERE Parent_ID = $EntryID") or die('Query failed: ' . mysql_error());
            $tmp = mysql_fetch_array($Replies, MYSQL_ASSOC);

            $NumReplies = $tmp["NumReplies"];
            if($NumReplies != 0){
                  echo "<a style=\"text-decoration:none\" href = \"board.php?Entry=$EntryID&Reply=true&Language=$Language&DB_Name=$DB_Name\">";
            }
            echo $NumReplies;
            if($NumReplies != 0){
                  echo "</a>";
            }
            echo "</font></td>";
            echo "\t\t</b></tr>\n";

            if ($ShowEntry != 0 && $EntryID == $ShowEntry){
                  echo "<tr bgcolor = #$Color align = \"left\" height = 19 class=\"body_text\" charoff=5>";
                  /* echo "<td align = \"right\"><font color=\"#000000\"><b>Content:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</b></font></td>"; */
                  echo "<td colspan = 2><span class=\"bb_body_text\"><font color=\"#000000\">";
                                                                echo "<table align = \"left\" valign=\"top\" border = 0 width = 439 cellspacing = 0 cellpadding = 0>";
                                                                echo "<tr bgcolor=#$Color height=19 class=\"body_text\">";
                                                                echo "<td width=6%>&nbsp;</td><td width=94%><font color=\"#000000\">";
                  $Content = $line["Entry"];
                  echo $Content;
                  echo '<br><br>';
                                                                echo "</font>";
                  echo "<a href=\"WriteReply.php?ParentID=$EntryID&Table=$Table&Language=$Language&DB_Name=$DB_Name\" onClick=\"return popup(this, 'notes')\">REPLY</a>";
                  echo "<br><br>";
                  echo "</font></span></td></tr></table></td></tr>";
            }
            if ($ShowReply == true && $ShowEntry == $EntryID){
                  $Replies = mysql_query("SELECT * FROM $TableRepl WHERE Parent_ID = $EntryID ORDER BY Reply_ID") or die('Query failed: ' . mysql_error());

                  while($ReplLine = mysql_fetch_array($Replies, MYSQL_ASSOC)){
                                echo "<tr bgcolor = #$Color align = \"left\" height = 19 class=\"body_text\">";
                        echo "<td align = \"right\"><font color=\"#000000\"><b>Re:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</b></font></td>";
                        echo "<td colspan = 2><font color=\"#000000\">";
                                                                                     echo "<table align = \"left\" valign=\"top\" border = 0 width = 439 cellspacing = 0 cellpadding = 0>";
                                                                                     echo "<tr bgcolor=#$Color height=19 class=\"body_text\">";
                                                                                     echo "<td width=6%>&nbsp;</td><td width=94%><font color=\"#000000\">";
                        echo $ReplLine["Reply"];
                        echo "</font></font></td></tr></table></td></tr>";
                  }
            }
      }

      mysql_close($link);

      echo '

      <form name="Search" action="board.php" method="get">
<tr bgcolor=#ffffff align="center" valign="middle" class="bb_text">
<!--<td width = 110>

      
</td> -->
<td width = 390><table width="350" border="0" cellspacing="0" cellpadding="2">
  <tr>
    <td><select name="SearchBy">
      <option value="Title"><span class="body_text">TITLE</span>
      <option value="Entry"><span class="body_text">CONTENT &nbsp; &nbsp;</span>
      </select>&nbsp;</td>
    <td><input type="text" name="SearchThis" size="55%">&nbsp;</td>
  </tr>
</table>

      
</td>
<td width = 80>
      <input type="submit" value="SEARCH" style>
</td>
</tr>


      ';

      echo "
        <tr><td>
      <input type=\"hidden\" name=\"Language\" value=$Language>
      <input type=\"hidden\" name=\"DB_Name\" value = $DB_Name> </td></tr>
</table>
      </form>
      ";
?>
</div>
</body>
0
Comment
Question by:pwdavismd
  • 2
4 Comments
 
LVL 10

Expert Comment

by:Khanh Doan
ID: 16948629
I think you should resize your table and enable scrolling, because when i click in CLEANER or smth else, frame's height isn't enought.
Bonmat86.
0
 
LVL 14

Accepted Solution

by:
ThG earned 500 total points
ID: 16949929

iframe is a fixed box that displays a web page. you can't make it extendible to its content's height. why don't you just insert your php code into the external page, and drop the iframe?

another way could be:
replace "<iframe src="../koam_bb_kor/board.php?Language=KOR&DB_Name=BUS" width="549" frameborder="0" marginheight="1px" marginwidth="1px" scrolling="no" height="706"></iframe>"

with "<?php

$_GET['Language'] = "KOR";
$_GET['DB_Name'] = "BUS";
include("../koam_bb_kor/board.php");
?>

obviously making the appropriate changes to board.php
0
 
LVL 1

Author Comment

by:pwdavismd
ID: 16956747
php include is a good idea but the page is also using ssi  so changing the extension breaks the ssi stuff which I don't really want to recode
0
 
LVL 1

Author Comment

by:pwdavismd
ID: 16956750
the real issue is with board.php which has not been addressed. It's too wide and I don't understand why
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Generating table dynamically is the most common issue faced by php developers.... So it seems there is a need of an article that explains the basic concept of generating tables dynamically. It just requires a basic knowledge of html and little maths…
Build an array called $myWeek which will hold the array elements Today, Yesterday and then builds up the rest of the week by the name of the day going back 1 week.   (CODE) (CODE) Then you just need to pass your date to the function. If i…
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.

863 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now