pointing an iframe to a .php file

Thread Solved

Join Date: May 2008
Posts: 27
Reputation: xylude is an unknown quantity at this point 
Solved Threads: 0
xylude xylude is offline Offline
Light Poster

pointing an iframe to a .php file

 
0
  #1
Jul 23rd, 2008
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.
  1. <iframe src="../thumbloader.php" name="thumbnails" align="middle" scrolling="auto">
Reply With Quote Quick reply to this message  
Join Date: Jun 2008
Posts: 849
Reputation: R0bb0b is on a distinguished road 
Solved Threads: 67
R0bb0b's Avatar
R0bb0b R0bb0b is offline Offline
Practically a Posting Shark

Re: pointing an iframe to a .php file

 
0
  #2
Jul 23rd, 2008
post your code on from thumbloader.php
“Be who you are and say what you feel because those who mind don't matter and those who matter don't mind.” - Dr. Seuss

-- The documentation is inevitable, you may get away with it for a little while but eventually you too will have to do the deed.
Reply With Quote Quick reply to this message  
Join Date: May 2008
Posts: 27
Reputation: xylude is an unknown quantity at this point 
Solved Threads: 0
xylude xylude is offline Offline
Light Poster

Re: pointing an iframe to a .php file

 
0
  #3
Jul 23rd, 2008
This script works fine on its own just not in the iframe...

  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.
Reply With Quote Quick reply to this message  
Join Date: Jun 2008
Posts: 849
Reputation: R0bb0b is on a distinguished road 
Solved Threads: 67
R0bb0b's Avatar
R0bb0b R0bb0b is offline Offline
Practically a Posting Shark

Re: pointing an iframe to a .php file

 
0
  #4
Jul 23rd, 2008
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.
“Be who you are and say what you feel because those who mind don't matter and those who matter don't mind.” - Dr. Seuss

-- The documentation is inevitable, you may get away with it for a little while but eventually you too will have to do the deed.
Reply With Quote Quick reply to this message  
Join Date: May 2008
Posts: 27
Reputation: xylude is an unknown quantity at this point 
Solved Threads: 0
xylude xylude is offline Offline
Light Poster

Re: pointing an iframe to a .php file

 
0
  #5
Jul 24th, 2008
Can anyone else take a look at this for me?
Reply With Quote Quick reply to this message  
Join Date: Nov 2007
Posts: 596
Reputation: buddylee17 has a spectacular aura about buddylee17 has a spectacular aura about 
Solved Threads: 125
buddylee17's Avatar
buddylee17 buddylee17 is offline Offline
Posting Pro

Re: pointing an iframe to a .php file

 
0
  #6
Jul 24th, 2008
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.
Lost time is never found again.
- Benjamin Franklin
Reply With Quote Quick reply to this message  
Join Date: May 2008
Posts: 27
Reputation: xylude is an unknown quantity at this point 
Solved Threads: 0
xylude xylude is offline Offline
Light Poster

Re: pointing an iframe to a .php file

 
0
  #7
Jul 24th, 2008
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
Reply With Quote Quick reply to this message  
Reply

This thread has been marked solved.
Perhaps start a new thread instead?
Message:



Similar Threads
Other Threads in the PHP Forum
Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC