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.

<iframe src="../thumbloader.php" name="thumbnails" align="middle" scrolling="auto">

post your code on from thumbloader.php

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);

?>

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.

Can anyone else take a look at this for me?

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.

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 :)

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.