Jump to content
xisto Community
alex1985

Php Code Needed?

Recommended Posts

Thanks for your useful replies. How can I add to this script an additional function that like everyone can BB Codes when typing something? That's very popular used in forums as well as portals, for instance, insert a link.

You mean bbcodes in the email itself? Well you would have to use a function to parse the bbcode into html such as preg_replace, and then use the headers in the mail function to allow html in the email.

 

For parsing bbcode you should learn regular expressions if you want to be able to do this efficiently.

Here is an example of parsing the bold bbcode tag into html:

preg_replace(array("/\[b\]/","/\[\/b\]/"),array("/<b>/","/<\/b>/"),$input);

And for the headers add this:

MIME-Version: 1.0\r\nContent-type: text/html; charset=iso-8859-1\r\n

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...

Important Information

Terms of Use | Privacy Policy | Guidelines | We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.