- Readme First! - Read and follow the rules, otherwise your posts will be closed
There are currently, 136 guest(s) and 0 member(s) that are online. You are Anonymous user. You can register for free by clicking here
Nuke Cops :: View topic - Adding PHP Into Blocks [ ]
Author
Message
Metalp3n
Nuke Soldier
Joined: Dec 08, 2003
Posts: 17
Posted:
Sat Apr 03, 2004 7:30 am
I wish to add the following code into a block:
Code:
<? include "plug.php"; ?>
Can any-one help me with this?
Smitty
Nuke Cadet
Joined: Jun 22, 2003
Posts: 7
Posted:
Sat Apr 03, 2004 12:09 pm
I made a block to include a php file. This is what I did, not usre its the best way to do it.
Code:
<?php
if (eregi("block-Server_Check.php", $_SERVER['PHP_SELF'])) {
Header("Location: index.php");
die();
}
global $user, $cookie, $prefix, $user_prefix, $dbi, $anonymous, $userinfo, $Default_Theme;
$content = "<center><iframe src=\"http://www.mysite.net/ping.php?iddfire&style=http://www.mysite.net/themes/fisubsilversh/style/style.css\" width=150 height=110 frameborder=0 /></iframe></center>";
?>
xenon2000
Nuke Cadet
Joined: Apr 02, 2004
Posts: 7
Posted:
Tue Apr 06, 2004 12:13 pm
Is there a way to just HAVE some php code directly in a block?
Like
<?php echo "This is a test"; ?>
I tired this, and it just seems to parse and drop this out entirely and just shows HTML formatted stuff in my blocks.
I don't want to do iFrames, layers, etc.. just want it to process some php within the blocks.
I also want to integrate phpNuke into my custom php apps, but I have that posted in another thread.
Asuka
Nuke Cadet
Joined: Mar 31, 2004
Posts: 9
Location: Denmark
Posted:
Thu Apr 15, 2004 9:13 pm
Well for php to work in a block you first need to open the php coding
Code:
<?php
echo "this is a test
?>
I dont know much of php, hope this helps
_________________
BooM
Nuke Soldier
Joined: Mar 18, 2004
Posts: 12
Posted:
Fri Apr 16, 2004 5:00 am
the correct format for a blocks is:
Code:
<?php
if (eregi("block-BLOCK_NAME_HERE.php", $_SERVER['PHP_SELF'])) {
Header("Location: index.php");
die();
}
$content = "this is a test";
?>
djalecc
Lieutenant
Joined: Feb 21, 2004
Posts: 180
Location: Gloucestershire
Posted:
Thu Apr 22, 2004 9:33 am
try...
Code:
<?php
if (eregi("block-BLOCK_NAME_HERE.php", $_SERVER['PHP_SELF'])) {
Header("Location: index.php");
die();
}
include("plug.php");
?>
would that not work?
_________________Free Dating
Courier Service Foook It!
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum