User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the PHP section within the Web Development category of DaniWeb, a massive community of 402,915 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 3,152 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: 238 | Replies: 6 | Solved
Reply
Join Date: May 2008
Posts: 12
Reputation: xylude is an unknown quantity at this point 
Rep Power: 1
Solved Threads: 0
xylude xylude is offline Offline
Newbie Poster

pointing an iframe to a .php file

  #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.
 <iframe src="../thumbloader.php" name="thumbnails" align="middle" scrolling="auto">
AddThis Social Bookmark Button
Reply With Quote  
Join Date: Jun 2008
Location: Phoenix, AZ
Posts: 601
Reputation: R0bb0b is on a distinguished road 
Rep Power: 2
Solved Threads: 53
R0bb0b's Avatar
R0bb0b R0bb0b is offline Offline
Practically a Master Poster

Re: pointing an iframe to a .php file

  #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
Reply With Quote  
Join Date: May 2008
Posts: 12
Reputation: xylude is an unknown quantity at this point 
Rep Power: 1
Solved Threads: 0
xylude xylude is offline Offline
Newbie Poster

Re: pointing an iframe to a .php file

  #3  
Jul 23rd, 2008
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.
Reply With Quote  
Join Date: Jun 2008
Location: Phoenix, AZ
Posts: 601
Reputation: R0bb0b is on a distinguished road 
Rep Power: 2
Solved Threads: 53
R0bb0b's Avatar
R0bb0b R0bb0b is offline Offline
Practically a Master Poster

Re: pointing an iframe to a .php file

  #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
Reply With Quote  
Join Date: May 2008
Posts: 12
Reputation: xylude is an unknown quantity at this point 
Rep Power: 1
Solved Threads: 0
xylude xylude is offline Offline
Newbie Poster

Re: pointing an iframe to a .php file

  #5  
Jul 24th, 2008
Can anyone else take a look at this for me?
Reply With Quote  
Join Date: Nov 2007
Location: Arkansas
Posts: 368
Reputation: buddylee17 will become famous soon enough buddylee17 will become famous soon enough 
Rep Power: 2
Solved Threads: 70
buddylee17's Avatar
buddylee17 buddylee17 is offline Offline
Posting Whiz

Re: pointing an iframe to a .php file

  #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  
Join Date: May 2008
Posts: 12
Reputation: xylude is an unknown quantity at this point 
Rep Power: 1
Solved Threads: 0
xylude xylude is offline Offline
Newbie Poster

Re: pointing an iframe to a .php file

  #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  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

DaniWeb PHP Marketplace
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

Thread Tools Display Modes

Similar Threads
Other Threads in the PHP Forum

All times are GMT -4. The time now is 4:02 pm.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC