•
•
•
•
What is DaniWeb IT Discussion Community?
You're currently browsing the PHP section within the Web Development category of DaniWeb, a massive community of 401,448 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,914 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our PHP advertiser: Lunarpages PHP Web Hosting
Views: 231 | Replies: 6 | Solved
![]() |
•
•
Join Date: May 2008
Posts: 12
Reputation:
Rep Power: 1
Solved Threads: 0
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.
(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.
<iframe src="../thumbloader.php" name="thumbnails" align="middle" scrolling="auto">
•
•
Join Date: Jun 2008
Location: Phoenix, AZ
Posts: 599
Reputation:
Rep Power: 2
Solved Threads: 53
•
•
Join Date: May 2008
Posts: 12
Reputation:
Rep Power: 1
Solved Threads: 0
This script works fine on its own just not in the iframe...
<?
$dbhost = 'localhost';
$dbusername = 'xylude';
$dbpassword = '';
$database_name = 'allprodata';
$connection = mysql_pconnect("$dbhost", "$dbusername", "$dbpassword")
or die ("Could not connect to database");
$db = mysql_select_db("$database_name", $connection)
or die ("Could not find database");
$returnstrings = mysql_query("SELECT * FROM videos WHERE category = 'dice'")
or die(mysql_error());
$rowcount = 0;
echo " <table width='200' border='1'>";
while ($result = mysql_fetch_assoc($returnstrings))
{
$rowcount = $rowcount + 1;
$thumbnail = $result ['vidthumbsrc'];
$hlink = $result ['previewurl'];
echo "<td align = 'center'><img src = '$thumbnail'><br>";
echo "<a href = '$hlink'>";
echo $result ['name'];
echo "</a></td>";
if ($rowcount == 4)
{
echo "</tr>";
echo "<tr>";
$rowcount = 0;
}
}
echo mysql_num_rows($returnstrings);
?>
Last edited by xylude : Jul 23rd, 2008 at 10:14 pm.
•
•
Join Date: Jun 2008
Location: Phoenix, AZ
Posts: 599
Reputation:
Rep Power: 2
Solved Threads: 53
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
![]() |
•
•
•
•
•
•
•
•
DaniWeb PHP Marketplace
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
- free php/mysql programming (Web Development Job Offers)
Other Threads in the PHP Forum
- Previous Thread: PHP Pear
- Next Thread: execute behind the scene mysql update/insert query just on button click


Linear Mode