Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » PHP Development Tools (PDT) » HTML and PHP mixed content
HTML and PHP mixed content [message #501083] Mon, 30 November 2009 22:52 Go to next message
Bryan Mising name is currently offline Bryan Mising nameFriend
Messages: 10
Registered: October 2009
Junior Member
Hi everyone here is an easy question for you. For security reasons I have a website that consist of only .htm files. I have set my Apache server to parse .htm as PHP content.

If I have the following code block.

<html>
<head>
<title>Test</title>
</head>
<body>
<?
print("hello world");
?>
</body>
</html>

I see that the HTML content is color coded by PDT and I can do formatting and validation on the HTML code.

But the PHP code embedded in the HTML is not color coded and I cannot format the code. PDT simply thinks it is plain text or something.

How to I set PDT to parse both the HTML code and the PHP code at the same time in a .htm file?

thanks
Re: HTML and PHP mixed content [message #501100 is a reply to message #501083] Tue, 01 December 2009 03:33 Go to previous messageGo to next message
Lichi G is currently offline Lichi GFriend
Messages: 11
Registered: July 2009
Junior Member
You can change the associated editor for *.htm files, assigning the PHP Editor instead of the HTML Editor.

You should go: Preferences > Editors > File Associations

Regards.
Re: HTML and PHP mixed content [message #501342 is a reply to message #501100] Tue, 01 December 2009 21:46 Go to previous messageGo to next message
Bryan Mising name is currently offline Bryan Mising nameFriend
Messages: 10
Registered: October 2009
Junior Member
Well, then only the PHP code will be formatted and the HTML code will not, correct?

My question was how do I get the editor to parse both PHP and HTML code at the same time?

I can't imagine that I am the first one on the planet to put embedded PHP code inside HTML code.

thanks
Re: HTML and PHP mixed content [message #501363 is a reply to message #501342] Tue, 01 December 2009 23:26 Go to previous message
Lichi G is currently offline Lichi GFriend
Messages: 11
Registered: July 2009
Junior Member
Bryan wrote on Tue, 01 December 2009 16:46
Well, then only the PHP code will be formatted and the HTML code will not, correct?



NO. that is not correct. The PHP Editor also support HTML syntax formating.

The PHP Editor will treat as PHP everything inside a php block "<? ... ?>" and
it will treat as HTML everything else outside of the php block.




Previous Topic:"org.eclipse.ui.ide.workbench" could not be found in the registry
Next Topic:Using PDT's parser outside of the IDE
Goto Forum:
  


Current Time: Tue Apr 16 15:18:00 GMT 2024

Powered by FUDForum. Page generated in 0.13312 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top