Why is the iframe content empty?

I am trying to understand this bit of code:

in display.php:

<html>
...
<body>
  <table>
     <tr>
       <td>
         User info: <iframe id="SpControlFrame1" name="SpControlFrame1" src="javascript:'';"path_src="index.php?cmd=YYY" ></iframe>
        </td>
     </tr>
   </table>
 </body>
 </html>

      

in another file, I have a switch statement:

main.php

switch ("cmd") {
 case ZZZ:
   include("foo.php");
   break;
 case YYY:
   include("blah.php")
   break;
}

      

blah.php:

<?php
 //some functions for processing
?>
<html>
 <head>
  ...
 </head>
 <body>
   <input type="text" size="12" name="username">
   <input type="button" value="submit">
  </body>
</html>

      

1) So, can you explain what's going on here? The iframe is embedded in the page and doesn't trigger a reload or anything like that.

2) I am trying to duplicate this function on another page, but the iframe is always empty (I checked this using the IE developer toolbar)

0


source to share


2 answers


Without seeing the code in question, I couldn't tell what was going on. Your example assumes the code in question is server-side, and when a particular variable / condition is executed, an iframe is created or populated by blah.php.



You will need to make sure the same code is called when this other iframe is created. Perhaps you could expand on this code? Source for original and source for new (not an iframe, but containing a document).

+2


source


How does it work for you?



User info: <iframe id="SpControlFrame1" name="SpControlFrame1" src="index.php?cmd=YYY" ></iframe>

      

0


source







All Articles