PHP in an HTML Nugget
Posted: Mon Oct 22, 2012 11:47 am
Hi all
I have inserted an HTML Nugget into a sidebar and then placed a bit of HTML code into it. Naturally, this worked exactly as expected.
So I then inserted a second HTML Nugget directly below the first one. If I then put a bit of HTML code into this nugget, it also works as expected. But what I am really trying to do is to put some HTML code together with a bit of PHP code into this nugget. But it doesn't seem to want to parse the PHP bit and just displays it along with the HTML result. Just in case I'm completely on the wrong track, below is why I want to do this. Maybe there is another better way?
I want to place a small form in the sidebar. When the visitor fills in the form and clicks the Submit button, any entered comments in the form are emailed to me. I tried MAILTO: but that was too messy! I have found that my host has Pear Mail installed, so I then put a form in the nugget which loaded an external PHP file to send the email to me with the form data.
Now, this all worked except if I wanted to display a message telling the visitor that the email was sent, then this message was displayed on a new blank page. Which also isn't very nice!
So then I tried to put the PHP code in the "same page" as the HTML code, which obviously works outside Serendipity, but not in a HTML Nugget.
Does anyone know of a plugin or another method that will enable my to achieve what I'm trying to do?
Thanks
Terry
I have inserted an HTML Nugget into a sidebar and then placed a bit of HTML code into it. Naturally, this worked exactly as expected.
So I then inserted a second HTML Nugget directly below the first one. If I then put a bit of HTML code into this nugget, it also works as expected. But what I am really trying to do is to put some HTML code together with a bit of PHP code into this nugget. But it doesn't seem to want to parse the PHP bit and just displays it along with the HTML result. Just in case I'm completely on the wrong track, below is why I want to do this. Maybe there is another better way?
I want to place a small form in the sidebar. When the visitor fills in the form and clicks the Submit button, any entered comments in the form are emailed to me. I tried MAILTO: but that was too messy! I have found that my host has Pear Mail installed, so I then put a form in the nugget which loaded an external PHP file to send the email to me with the form data.
Now, this all worked except if I wanted to display a message telling the visitor that the email was sent, then this message was displayed on a new blank page. Which also isn't very nice!
So then I tried to put the PHP code in the "same page" as the HTML code, which obviously works outside Serendipity, but not in a HTML Nugget.
Does anyone know of a plugin or another method that will enable my to achieve what I'm trying to do?
Thanks
Terry