WordPress.org

Forums

QuickPHP and include statements (8 posts)

  1. amirs
    Member
    Posted 9 years ago #

    Hi. I'm trying to get CG-QuickPHP to use a php 'include' statement into a post, to include a php file. I'm using the following statement, but it isn't working (nothing is being included):

    <quickphp include('http://mydomain.com/dir/file.php'); />

    Is this the correct way of using quickPHP and/or the correct way of specifying the location of the normal.php file? Does QuickPHP support 'include'? Or should I just specify a relative location, like:

    <quickphp include('dir/file.php'); />

    Any help would be appreciated.

    Thanks,
    Amir

  2. Joshua Sigar
    Member
    Posted 9 years ago #

    Well, did the second code not work? Make sure you activate the plugin.

    The first one is likely not to work because of the server security settings.

  3. Beel
    Member
    Posted 9 years ago #

    Sorry, but from the instructions:

    it's useful for anyone needed to call a quick function or template tag WITHIN the body of a Post or a Page.

    and from the author's original thread...

    CG-QuickPHP does embedded PHP in a post/page, with a one-function-call restriction.

  4. amirs
    Member
    Posted 9 years ago #

    Alphaoide: the plugin is activated, and neither version of works. any other ideas?

    Beel: I AM calling the function from within a page. what makes you I'm not?

  5. Since the plugin appears to operate as a PHP interpreter, it may lack certain PHP functionalities, such as include.

    Try using a normal PHP include with this plugin activated: http://priyadi.net/archives/2005/03/02/wordpress-php-exec-plugin/

  6. Beel
    Member
    Posted 9 years ago #

    Yes, macmanx is correct. I suggest you read the section in the instructions that came with the plugin entitled "What are its limits?"

    It is possible you can get your file.php to work but not as an include.

  7. Beel
    Member
    Posted 9 years ago #

    Oops, hitting the spacebar when in screen saver mode evidentally adds an empty post.

  8. amirs
    Member
    Posted 9 years ago #

    Thanks. I ended up getting phpexec and it works perfectly. thanks for the help!

    Amir

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags