Jump to content

New Toolbar Button: Does it accept PHP?


Recommended Posts

Hey all,

I created a new toolbar button which takes input from the user, so {{content}}, and uses it in a PHP var.  I need {{content}} to be a string so I set it like:

$s = "{{content}}";
$matches = array();
$result = preg_match('/i=(?P<iVal>[0-9]+)&l=(?P<lVal>[a-z0-9]+)$/siU', $s, $matches);
$url_string = "http://mwo.smurfy-net.de/tools/mechtooltip?i=".$matches['iVal']."&l=".$matches['lVal'];
$embed_html = '<iframe src="'.$url_string.'" width="750" height="300" border="0"></iframe>';
echo $embed_html;

Here's an example URL of {{content}}:


I've tested this entire script in PHP sans the {{content}} part but using a variable set as string of the URL above and it works perfectly.

However, when I use the new button on my toolbar I always get the following error:




}"; $matches = array(); $result = preg_match('/i=(?P[0-9]+)&l=(?P[a-z0-9]+)$/siU', $s, $matches); $matches = array(); $result = preg_match('/i=(?P[0-9]+)&l=(?P[a-z0-9]+)$/siU', $s, $matches); $url_string = "http://mwo.smurfy-net.de/tools/mechtooltip?i=".$matches['iVal']."&l=".$matches['lVal']; $embed_html =



Not Found

The requested URL /comnet/'.$url_string.' was not found on this server.

Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.


''; echo $embed_html; ?>



First of all, does the HTML block for the button accept PHP?  Secondly, why is IP.Board appending my forum path in front of the URL and also not using the $url_string variable properly?

Any help would be greatly appreciated!

Link to comment
Share on other sites


This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Create New...