Jump to content

Problem displaying php content


turkman

Recommended Posts

I dont even know how to label this correctly. Basically i have a website on my intranet. With a link that takes you to a new page called contacts.php

 

contacts.php looks like this

 

<?php
include 'includes/tpl_vtop.html';
include 'includes/tpl_header.html';
include 'includes/tpl_lcol.html';
?>


<div id="ccol">

<div id="ccolhdr"><div class="hdrtxt">Contacts</div></div>
<div id="cleft>
	<?php 
	'include maincon_contact.php'; 
	?>


</div>
<div id="cright></div>

</div>

<?php
include 'includes/tpl_footer.html';
include 'includes/tpl_copyw.html';
include 'includes/tpl_vbottom.html';
?>

 

This is mostly includes to bring in the header footer etc, but in the main content box i call the maincon_contact.php script, this is a very basic script that connects to a database and displays the result. it looks like this

 


<?php

include'usephp/conf.php';
include 'usephp/opendb.php';

$query  = "SELECT * FROM contacts";
$result = mysql_query($query);



while($row = mysql_fetch_array($result, MYSQL_ASSOC))
{
	echo "Name: {$row['cname']} " .
	"Email: </strong></td><td>{$row['cemail']}";
}





include 'usephp/closedb.php';


?>

 

 

The idea being that contact will be formatted exactly like my index page (which works) and that the result of maincon_contact will be displayed in the ccol div (which dosent work). When i go to contact the ccol div is left blank and nothing is displayed. Which is weird because if i create a link directly to

maincon_contact and dont try to format the result in divs etc, then i get the result i want printed onto the screen.

 

So its just when i try to display it within a div etc it dosent display anything. Any ideas?

Link to comment
https://forums.phpfreaks.com/topic/112340-problem-displaying-php-content/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.