Adding PHP code in editor

744 views
Skip to first unread message

FNolan

unread,
Nov 1, 2011, 2:50:32 PM11/1/11
to bluegriffon
How would I go about adding PHP code to the HTML ? When I do it
changes it to a comment.

Example: <?php snippet /> becomes <!--? snippit /-->

glazou

unread,
Nov 1, 2011, 2:59:14 PM11/1/11
to bluegriffon
What about trying a *valid* php processing instruction like <?php
blablabla?>
and not an invalid one like <?php snippet /> ?

</Daniel>

Steve Whitson

unread,
Nov 1, 2011, 4:05:36 PM11/1/11
to blueg...@googlegroups.com, glazou
Valid question Daniel. But when I save my text.html and then reopen it,
the php code becomes commented out.

<p>hello world<br>
<!--?php echo "hello world" ?--> </p>

Can this be fixed, or is there a reason for this? Based on past threads
on this topic I'm not aware that bluegriffen supporting this yet. I'm
using v1.2.1. Maybe I'm just doing something wrong...

Thanks much,
-Steve

FNolan

unread,
Nov 1, 2011, 7:43:36 PM11/1/11
to bluegriffon
Sorry for the typo but I did have it right in the editor. Instead of
giving a sacastic reply try helping, you might have more friends that
way.

FNolan

unread,
Nov 1, 2011, 7:44:52 PM11/1/11
to bluegriffon
That's what I was saying Steve, so I'll assume it's the software and
not something I did. Maybe the creator/creators will read this and
give us some insight into it.
> > </Daniel>- Hide quoted text -
>
> - Show quoted text -

Daniel Glazman

unread,
Nov 1, 2011, 7:48:31 PM11/1/11
to blueg...@googlegroups.com
Le 01/11/11 16:43, FNolan a �crit :

> Sorry for the typo but I did have it right in the editor. Instead of
> giving a sacastic reply try helping, you might have more friends that
> way.

There is no sarcasm at all in my answer and I'm sorry if you caught
it that way. I just cannot understand, from this side of the wire,
there was a typo in your message. I entirely relied on your message's
contents, and I suggest you take things less personally and
emotionally here.

</Daniel>

Daniel Glazman

unread,
Nov 1, 2011, 7:50:35 PM11/1/11
to Steve Whitson, blueg...@googlegroups.com
Le 01/11/11 13:05, Steve Whitson a �crit :

> Valid question Daniel. But when I save my text.html and then reopen it,
> the php code becomes commented out.
>
> <p>hello world<br>
> <!--?php echo "hello world" ?--> </p>
>
> Can this be fixed, or is there a reason for this? Based on past threads
> on this topic I'm not aware that bluegriffen supporting this yet. I'm
> using v1.2.1. Maybe I'm just doing something wrong...

"text.html" is for me not enough as a bug report. What's the format
of that document ? HTML4/XHTML1/HTML5/XHTML5 ? Your "<br>" seems
to indicate HTML4. In that case, strict or transitional ?

We could have a limitation in the parser for one of these html flavors,
I'll investigate as soon as I have your answer *and* I am back from
the current W3C meeting in the Bay Area.

</Daniel>

FNolan

unread,
Nov 1, 2011, 8:30:04 PM11/1/11
to bluegriffon
If I took it wrong I apologize. That's the problem with the written
word, hard to tell how it's meant.

I think I figured out a work around. After adding the PHP code save
the HTML then open that in a HTML text editor, I use Crimson Editor.
Edit the PHP code so the syntax is right then save the file as a PHP
file and not an HTML. I did that and uploaded to my server and now the
PHP code works. Don't know why the BlueGriffon editor does what it
dose to the code.

Jazzzzz

unread,
Nov 18, 2011, 9:01:22 PM11/18/11
to bluegriffon
I was liking BlueGriffon until I just discovered the PHP "comment out"
bug and came here checking to see if it was some config setting
causing the strange behavior. It's kind of weird, I would think it is
harder to comment out PHP snippets automatically for no reason rather
than to let them be.

Reply all
Reply to author
Forward
0 new messages