...

View Full Version : includes displaying html source code



rptut
01-23-2004, 05:07 AM
I'm running into a problem that is probably just a simple fix to some one who knows what they are doing, so any insight would be welcomed.

I just moved a couple of sites from a server running Apache 1.3 with PHP 4.0.x installed to a server running Apache 2.0.2 with PHP 4.2.x installed.

I'm finding on 2 of the sites that some PHP includes that were pulling content (with html formatting) into an html page are showing all the html source with the content. The PHP is running or it wouldn't pull the includes into the page at all, but it looks as if the page is rendering first, then putting in the PHP.

Don't know if this makes sense or not, but here's an example...

Before the page looked like this:

Some copy
PHP Include copy (http://)
More copy

Now it looks like this:

Some copy
<b>PHP</b> <a href="">Include copy</a>
More copy


The actual html inside the include is not being rendered.

raf
01-23-2004, 12:51 PM
Welcome here.

Maybe post the code that you use to include the file + the code inside that file.

It should look like



include('thefileadress.php');


and then inside 'thefileadress.php'


<?php
echo ('<a href="www.foobar.com" title="Go to our main site">GO</a>');
?>



or



include('thefileadress.php');
echo $content;


and then inside 'thefileadress.php'


<?php
$content=('<a href="www.foobar.com" title="Go to our main site">GO</a>');
?>



Or maybe even something else depending on your code. But i can't make anything up out of your example

rptut
01-23-2004, 02:37 PM
I withdraw my question :o

In getting the code to answer your replay it just dawned on me that the problem was in the info being pulled from the database. Then, I realized what I had done... I exported my db from server 1 as a .txt file, instead of a .sql file... then imported into server 2. Somewhere along the lines it converted all my html code to the character code equivalent.

Sorry about that, but thanks for the help... you at least made me realize what I was doing :)



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum