943,735 Members | Top Members by Rank

Ad:
  • PHP Discussion Thread
  • Marked Solved
  • Views: 802
  • PHP RSS
Jul 23rd, 2008
0

pointing an iframe to a .php file

Expand Post »
Is there something special i need to do to get this to work? I made a script that builds a neat little table with pictures from the sql database, and want it to go into an iframe. When i run the code I get this:

(screenshot)
http://www.freewebs.com/xylude/helpme.jpg

It just shows the actual script in text form inside of the iframe.

Here is the tag I used to link to the php doc.
PHP Syntax (Toggle Plain Text)
  1. <iframe src="../thumbloader.php" name="thumbnails" align="middle" scrolling="auto">
Reputation Points: 13
Solved Threads: 11
Junior Poster
xylude is offline Offline
122 posts
since May 2008
Jul 23rd, 2008
0

Re: pointing an iframe to a .php file

post your code on from thumbloader.php
Reputation Points: 358
Solved Threads: 89
Posting Shark
R0bb0b is offline Offline
986 posts
since Jun 2008
Jul 23rd, 2008
0

Re: pointing an iframe to a .php file

This script works fine on its own just not in the iframe...

PHP Syntax (Toggle Plain Text)
  1.  
  2. <?
  3.  
  4. $dbhost = 'localhost';
  5. $dbusername = 'xylude';
  6. $dbpassword = '';
  7. $database_name = 'allprodata';
  8.  
  9.  
  10. $connection = mysql_pconnect("$dbhost", "$dbusername", "$dbpassword")
  11. or die ("Could not connect to database");
  12.  
  13. $db = mysql_select_db("$database_name", $connection)
  14. or die ("Could not find database");
  15.  
  16.  
  17.  
  18.  
  19.  
  20. $returnstrings = mysql_query("SELECT * FROM videos WHERE category = 'dice'")
  21. or die(mysql_error());
  22.  
  23.  
  24. $rowcount = 0;
  25.  
  26.  
  27. echo " <table width='200' border='1'>";
  28. while ($result = mysql_fetch_assoc($returnstrings))
  29. {
  30. $rowcount = $rowcount + 1;
  31.  
  32.  
  33. $thumbnail = $result ['vidthumbsrc'];
  34. $hlink = $result ['previewurl'];
  35. echo "<td align = 'center'><img src = '$thumbnail'><br>";
  36. echo "<a href = '$hlink'>";
  37. echo $result ['name'];
  38. echo "</a></td>";
  39. if ($rowcount == 4)
  40. {
  41. echo "</tr>";
  42. echo "<tr>";
  43. $rowcount = 0;
  44. }
  45. }
  46.  
  47. echo mysql_num_rows($returnstrings);
  48.  
  49. ?>
Last edited by xylude; Jul 23rd, 2008 at 11:14 pm.
Reputation Points: 13
Solved Threads: 11
Junior Poster
xylude is offline Offline
122 posts
since May 2008
Jul 23rd, 2008
0

Re: pointing an iframe to a .php file

That's strange because its just an http request as far as the server goes. It should just serve the html like normal. This doesn't make any sense to me, maybe someone else can give you more input.
Reputation Points: 358
Solved Threads: 89
Posting Shark
R0bb0b is offline Offline
986 posts
since Jun 2008
Jul 24th, 2008
0

Re: pointing an iframe to a .php file

Can anyone else take a look at this for me?
Reputation Points: 13
Solved Threads: 11
Junior Poster
xylude is offline Offline
122 posts
since May 2008
Jul 24th, 2008
0

Re: pointing an iframe to a .php file

I can't replicate your problem. It parses as normal html on my machine. Try to put a simple script like <?php echo "Hello world"; ?> in as an iframe and see if that parses.
Reputation Points: 232
Solved Threads: 137
Practically a Master Poster
buddylee17 is offline Offline
665 posts
since Nov 2007
Jul 24th, 2008
0

Re: pointing an iframe to a .php file

Im sorry for wasting your time guys. I figured out the problem. I was trying to run the html off of a dreamweaver site file that had no PHP testing server specified, lol. Thanks for your help though
Reputation Points: 13
Solved Threads: 11
Junior Poster
xylude is offline Offline
122 posts
since May 2008

This thread is solved

Either the thread starter or a moderator has marked this thread as solved. You can most likely trust the responses and answers given. There is most likely no reason for any further responses to be posted here. If you have a related question, please start a new thread in this forum instead.

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in PHP Forum Timeline: PHP Pear
Next Thread in PHP Forum Timeline: Secure PHP Login Script





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC