Jump to content

help...php in html


disturbed

Recommended Posts

I'm just now learning some php.

I'm getting some basic ideas of how it works and its going well...but I just cannot figure out why echo-ing php in html doesn't work....

If I have a php file with this contents:

echo "test echo";

$blah="display blah";

echo $blah;

and I run the file, it works great.

However, if I put in the same code inline with html code by:

<?php

echo "test echo";

$blah="display blah";

echo $blah;

?>

....nothing.  Empty.  Nothing gets displayed.

Why is this?  Also, because of this I cannot figure out how to use variables from php in html...same issue I believe.

Link to comment
Share on other sites

I believe 1.3.39 for apache and 4.4.4 for php although on the forums I noticed that the host said all shared are being moved to php 5

They should have moved to 5 a while ago. Who is your host?

If you put this in a info.php page it works right?

<?php

  phpinfo();

?>

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

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