PHP does not show HTML correct

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
mike2008i
Forum Newbie
Posts: 1
Joined: Wed Sep 17, 2008 2:14 pm

PHP does not show HTML correct

Post by mike2008i »

Hello,

at first i am newby in php-programming. I also have knowledge and experience in C/C++ and
XHTML, CSS. Now i want to programm server apss with php and using the db mysql.

I met the following problem:
when was testing at first time the test.php script which contains the following code,

Code: Select all

 
... 
<body>
     <?php
        echo "<p>The PHP Code</p>\n";
      ?>
</body>
...
 
i got this HTML-Site

Code: Select all

The PHP Code\n"; ?>
Even if i test with the phpinfo() instead of echo function i got an empty site.
I have set up the apache server correct because i got the welcome message.
I have also installed and configured the php5 module.
The language was set in the browser and script to utf-8.

Can somebody help me?

Thx
thinsoldier
Forum Contributor
Posts: 367
Joined: Fri Jul 20, 2007 11:29 am
Contact:

Re: PHP does not show HTML correct

Post by thinsoldier »

If you get an empty page with phpinfo() then I think you're server isn't actually processing php.
If you're not very familiar with apache+php etc.. I'd suggesting using an all-in-on package like wamp, mapm, or universal server etc...
With those there's nothing for you to "set up". Just execute 1 file and you've got your apache server+php, & mysql server running automagically. (Universal Server even creates a virtual W:\ drive. Just drop your sites into W:/www/ and access them with http://localhost/sitefolder/)
Warning: I have no idea what I'm talking about.
Post Reply