WordPress.org

Forums

Allow PHP in Posts and Pages
Plugin Doesn't Work (2 posts)

  1. JohnSM
    Member
    Posted 2 years ago #

    Hi!
    Does the plugin work under WP new version because the codes are pasted in Text Widget and saved but displayed as raw HTML.Below are the codes I tried to install in sidebar using Text Widget.

    <?php

    // The following variable defines whether links are opened in a new window
    $openInNewWindow = "1";
    $linkkey = "9b20845a-17b0-a924-75d4-a1fecc2de2bf";
    $url = urlencode((($_SERVER['HTTPS']=='on')?'https://':'http://').$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI']);
    $query = "pageurl=".$url;
    $query .= "&linkkey=" .urlencode($linkkey);
    $query .= "&newwindow=" .urlencode($openInNewWindow);
    $query .= "&referer=".urlencode($_SERVER['HTTP_REFERER']);

    //You can use any other function, which returns content back instead of CURL or readfile()
    if(intval(get_cfg_var('allow_url_fopen')) && function_exists('readfile')) {
    @readfile("http://www.backlinks4u.com/getlinksbox.php?".$query);
    }elseif(function_exists('curl_init')) {
    $ch = curl_init ("http://www.backlinks4u.com/getlinksbox.php?".$query);
    curl_setopt ($ch, CURLOPT_HEADER, 0);
    curl_exec ($ch);

    if(curl_error($ch))
    print "Error processing request";

    curl_close ($ch);
    }
    else {
    print "It appears that your web host has disabled all functions for handling remote pages.";
    }
    ?>

    Kindly let me know what when wrong here.
    Thanks

    http://wordpress.org/extend/plugins/allow-php-in-posts-and-pages/

  2. Hit Reach
    Member
    Plugin Author

    Posted 2 years ago #

    Hi John

    Do you have a URL we can view to see what is going on?

    Thanks
    Hit Reach

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Allow PHP in Posts and Pages
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic

Tags

No tags yet.