/    Sign up×
Community /Pin to ProfileBookmark

php print command to create html text

So, I’m hoping you can help me.

[code]
<div id=”tox”>
<p>About-us Contact Sign-in Sign-up <?php print “<h5>Hello World!</h5>”;?>
Who:Gretta</p></div>
[/code]

In the above code, I’m just trying to recall how to insert some html info via php…

I expected to see this appear on the result web page:
About-us Contact Sign-in Sign-up Hello World! Who:Gretta

However, I see this on the result web page:
About-us Contact Sign-in Sign-up Hello World!”;?> Who:Gretta

(note the quote mark, the semi-colon, the question mark, and the close carrot showing up in the print near the right side of the line)

Is there a ‘setting’ or something that I need to tweak to have the proper look to the page result – such that the quote, semi-colon, question mark, and close carrot don’t appear?

Thanks!

to post a comment
PHP

2 Comments(s)

Copy linkTweet thisAlerts:
@NogDogJun 16.2011 — Are you sure it's being processed as PHP? E.g.:

Does the file have a ".php" suffix (instead of ".hmtl")?

Is PHP installed on the server where you are testing?

If testing on a local web server installation on your PC, did you open the file via a "http://localhost/" URL rather than opening the file directly?
Copy linkTweet thisAlerts:
@gmarbachauthorJun 16.2011 — interesting...

the name of my page has .htm at the end (not .php)

i will try changing it to .php and see what happens...
×

Success!

Help @gmarbach spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.20,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...