GoFuckYourself.com - Adult Webmaster Forum

GoFuckYourself.com - Adult Webmaster Forum (https://gfy.com/index.php)
-   Fucking Around & Business Discussion (https://gfy.com/forumdisplay.php?f=26)
-   -   I need plugin to run php inside a wordpress post (https://gfy.com/showthread.php?t=795301)

spacedog 12-27-2007 08:48 PM

I need plugin to run php inside a wordpress post
 
I just tried phpexec & runphp, neither of which work.

Anyone got or know wordpress plugin that will allow me to run php inside a wordpress post?

teksonline 12-27-2007 09:18 PM

Exec-PHP is what to use no?

spacedog 12-27-2007 10:09 PM

Quote:

Originally Posted by teksonline (Post 13571183)
Exec-PHP is what to use no?

I tried that, didn't work.

I embedded code in between the tags and wordpress post shows the code instead of what the php is telling it to show

V_RocKs 12-28-2007 02:55 PM

Read the comments on Exec-php page and you will find a link to the new version that does work.

media 12-28-2007 02:57 PM

Quote:

Originally Posted by spacedog (Post 13571325)
I tried that, didn't work.

I embedded code in between the tags and wordpress post shows the code instead of what the php is telling it to show

Make sure you are editing in the "CODE" tab only and saving in the "CODE" tab.. once edited in the WYSIWYG editor it will fubar it... exec-php is great

~Ray 12-28-2007 03:38 PM

adman for wordpress in the www.wordpress.org plugins

wp.uberdose.com/2006/11/05/adman/

D Ghost 12-28-2007 03:39 PM

Yeah make sure you aren't using Visual editor. If you need help I am expert at Wordpress... hit me up

Twig 12-28-2007 03:42 PM

+1 for exec-php.

pip 12-28-2007 06:29 PM

Turn the stupid visual editor off, its pointless

spacedog 12-28-2007 06:48 PM

I have visual editor off and also have role manager plug in.

I have tgp on root & blog in dir.

Script is in root & I'm trying to include tgp script in post or page thats on blog in dir as;

Code:

<?
 include("../script.php");
 $query  = "SELECT COUNT(url) AS numrows FROM links";
 $result  = mysql_query($query) or die('Error, query failed');
 $row    = mysql_fetch_array($result, MYSQL_ASSOC);
 $numrows = $row['numrows'];
 
 $maxPage = ceil($numrows/65);

 $sql = "SELECT url, title, date FROM `links` ORDER BY date DESC LIMIT ".$offset.", 65;";
 $rs = mysql_query($sql);
 echo mysql_error();
 
 
 $self = $_SERVER['PHP_SELF'];
 $nav = '';
 for($page = 1; $page <= $maxPage; $page++)
 {
    if ($page == $pageNum)
    {
        $nav .= " $page ";
    }
    else
    {
        $nav .= " <a href=\"$self?page=$page\">$page</a> ";
    }
 }

while($row = mysql_fetch_row($rs)){
    echo "<a href=\"".$row[0]."\">".$row[1]."</a>".$row[2]."\n<br>\n";}

 echo "<p>Page: ";
 $self = $_SERVER['PHP_SELF'];
 $nav = '';
 for($page = 1; $page <= $maxPage; $page++)
 {
    if ($page == $pageNum)
    {
        $nav .= " $page ";
    }
    else
    {
        $nav .= " <a href=\"$self?page=$page\">$page</a> ";
    }
 }

echo $first . $prev . $nav . $next . $last;
 mysql_close();
?>

and I end up with on the post
Code:

You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near ? 65′ at line 1
Warning: mysql_fetch_row(): supplied argument is not a valid MySQL result resource in /dirname/0/blahblah/htdocs/file/name/wp-content/plugins/exec-php/runtime.php(41) : eval()?d code on line 29


V_RocKs 12-28-2007 11:58 PM

This is because $offset isn't holding a value.

How is offset being passed to your script?

If it is by the address (GET) then you need something like:
Code:

$offset = $_GET['offset'];
This is because your server might have register globals turned off for security reasons.

remii 12-29-2007 03:00 AM

run_php works great for me !
http://dev.wp-plugins.org/wiki/RunPHP

spacedog 12-29-2007 08:11 AM

Quote:

Originally Posted by V_RocKs (Post 13575544)
This is because $offset isn't holding a value.

How is offset being passed to your script?

If it is by the address (GET) then you need something like:
Code:

$offset = $_GET['offset'];
This is because your server might have register globals turned off for security reasons.

It's not the server. Scripts running fine on the main page.

So I have this text tgp for a bit on domain.com then decided to add a blog on domain.com/blog and now I'm trying to include the script in a blog post or a blog page so I can move blog to domain.com & still have the text tgp present on the site.

The Duck 12-29-2007 08:22 AM

exec-php should do the trick

spacedog 12-29-2007 08:26 AM

Quote:

Originally Posted by kandah (Post 13576201)
exec-php should do the trick

But it's not. This is what I'm trying to get to work & am getting the errors shown in post above


All times are GMT -7. The time now is 04:33 AM.

Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2026, vBulletin Solutions, Inc.
©2000-, AI Media Network Inc123