Support » Fixing WordPress » Howto insert scripts into pages?

  • Is there a language-neutral way to insert the results of server side scripts?

    ie. I have some C++ (and shell,lua, php, etc) scripts that return lists of data from a DB that I’d like to integrate into my WordPress blog.

    What is the easiest way to do this?

    I’ve seen mention of inserting a <script> tag (which didn’t work) and I’ve also seen the use of a .shtml <include> tag (which won’t help me here, that I’m aware of).

    Thanks

    Matt

Viewing 9 replies - 1 through 9 (of 9 total)
  • Moderator Samuel Wood (Otto)

    (@otto42)

    WordPress.org Admin

    Is there a language-neutral way to insert the results of server side scripts?

    No.

    I have some C++ (and shell,lua, php, etc) scripts that return lists of data from a DB that I’d like to integrate into my WordPress blog. What is the easiest way to do this?

    Depends on lots of factors. How would you execute these scripts normally? I can think of various ways to do it, but which way you do it depends on what exactly you’re doing. 😉

    The Exec-PHP plugin can run PHP.
    http://wordpress.org/extend/plugins/exec-php/

    Or do you mean syntax highlighting?

    Moderator Samuel Wood (Otto)

    (@otto42)

    WordPress.org Admin

    haochi: He doesn’t mean either of those, he’s talking about something similar to server-side-includes, basically.

    http://www.google.com/search?q=SSI+include

    Thread Starter tazatek

    (@tazatek)

    The normal way that I call them is at a command-line and it outputs either to stdout, or a file. There are typically no arguments given, though occasionally there are.

    I’m wanting to have it auto-populate (ie no user-interaction) as a simple list of output, probably formatted within a <div> or <table>

    Thanks
    Matt

    Moderator Samuel Wood (Otto)

    (@otto42)

    WordPress.org Admin

    The normal way that I call them is at a command-line

    That makes it tricky then, although not much. There’s several PHP functions to execute local commands:
    http://php.net/manual/en/ref.exec.php

    Thread Starter tazatek

    (@tazatek)

    Is there any way that I can turn on SSI inside of WordPress Pages/Posts? Looking around Apache’s site, it looks like I might be able to include the output of a CGI inside of a <table>

    My biggest hangup is I don’t know what to use for the AddType entry in my .htaccess/httpd.conf file. Any suggestions? All the examples use .shtml, but with WP being processed .php, I’m not sure of what to enter there.

    Thanks

    Matt

    Thread Starter tazatek

    (@tazatek)

    I’ve tested the exec-php plugin to insert php code, and it works… but only for the last echo statement in my script…. any thoughts on this?

    Would anyone know if it would be the plugin, or a config/script issue?

    Thanks

    Matt

    Thread Starter tazatek

    (@tazatek)

    Arrrgggghh…. seems 2 minutes after my post I figured it out… I was using an echo in the script, and it seems that it prefers printf…. different line endings by default IIRC

    But I’d still like to know if it is possible to activate SSI within WordPress…. for prosperity’s sake I suppose 🙂

    Thanks

    Matt

    Moderator Samuel Wood (Otto)

    (@otto42)

    WordPress.org Admin

    Not as such, but look closely at the PHP “virtual” function. It will make a callback to Apache to do the equivalent of a server side include.

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘Howto insert scripts into pages?’ is closed to new replies.