Jump to content

[SOLVED] Not outputting anything


lpse2000

Recommended Posts

Hi everyone. I'm brand new to PHP and this forum. The problem I'm having is that I have a .html file with some PHP code in it. Everything displays except what I'm expecting it to out of the PHP code. I assume this is more of a server problem than a problem in my PHP script because if a file only has PHP code in it, it displays perfectly.

 

Here's my code.

<html>
<head>
<title>Test PHP and HTML</title>
</head>

<body>

<h1>Test Test</h1>

<?php
  echo "<b> test </b> test";
?>

that's all folks

</body>

 

Anyone here run into this before or know where I should look into?

 

Thanks,

Michael

Link to comment
Share on other sites

The extension on the file must be .php so that the server knows to process the file before sending it to the browser.

 

*edit* to expand on that.  All processing of PHP code is done server-side.  Any PHP that's not processed when sent to the browser is just dropped, as browsers don't have the ability to process it.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.