Fellow Monasterians,

I have a simple content manager that uses the expected Perl/MySQL/HTML::Template in relative harmony. However, rolling my own wysiwyg editor has proven monumental, so I've decided to use WysiwygPro editor.

It's a powerful editor, but requires a php file to fire it up. Not a problem, until it comes to passing the content-to-edit from my Perl/MySQL routines to the .php. Three possibilities come to mind:

1) Learn PHP and handle the MySQL from within the .php, bypassing Perl altogether. Update: drats, security issues trying to avoid hardcoding the DBI log-on info.

2) From within Perl, fetch and print the content to a temporary text file on the server, and then use php within the .php file to retrieve and assign it accordingly. Seems goofy.

3) Print my .php as a heredoc, populating it from within my Perl script. Update: Can't seem to get this to work. Maybe it's not possible to print a .php file to screen.

The 1st and 3rd options seem best, the first being the cleanest, learning enough PHP to do the work, notwithstanding.

Of course, it would be great to have something like PHP::Template (maybe there is something like it), but in the meantime, what's the monastery's take on this? Thanks


—Brad
"Don't ever take a fence down until you know the reason it was put up." G. K. Chesterton

In reply to Starting a PHP file from Perl by bradcathey

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.