Is it possible to run PHP Scripts in Modules?

  Post new topicReply to topicPrintable Version
<< View previous topic View next topic >>
Share: Del.icio.us  Digg  Google  Spurl  Blink  Furl  Y! MyWeb  
#1   Is it possible to run PHP Scripts in Modules?
ubernvs
CZ Newbie
ubernvs has been a member for over 17 year's 17 Year Member
Gender: Male
Status: Offline
Joined: Feb 06, 2007
0.00 posts per day
Posts: 2
Points: 0
   
Hi... Sorry if this is a repost. I searched and couldn't find anything.

Is it possible to open a *.php file in a phpnuke module? I tried using the PHPNuke Tools addon but the code it gave me was wrong. I have a template for a blank module but when I tried adding the php to the module it didn't work. Basically I have a php upload script so users can upload files to my webserver (I am aware of the risk). The php script works fine alone, but its very plain so I wanted to add it to my phpnuke site using my theme. And this way I can moderate who uploads with the subscriber setting. So I was hoping there was a way to call the php script inside my blank module if possible? Here is the code for my blank module...


<?php 

if (!stristr($_SERVER['SCRIPT_NAME'], "modules.php")) {
die ("You can't access this file directly...");
}
   
require_once("mainfile.php");
$module_name = basename(dirname(__FILE__));
$pagetitle = "- $module_name";

$index = 0; // 0 = No Right Blocks | 1 = Show Right Blocks!

include("header.php");

// Grabs the Username! use $user_name for Username!
global $user;
if(!is_array($user)) {
$user_get = base64_decode($user);
$user_get = explode(":", $user_get);
$user_name = "$user_get[1]";
} else {
$user_name = $user[1];
}

OpenTable();
echo "<table width=\"100%\" border=\"0\" align=\"center\"><tr><td align=\"center\">";

// Content Below
echo "
PUT CONTENT HERE!!!!!!!!! PUT CONTENT HERE!!!!!!!!!<BR>
PUT CONTENT HERE!!!!!!!!! PUT CONTENT HERE!!!!!!!!!<BR>
PUT CONTENT HERE!!!!!!!!! PUT CONTENT HERE!!!!!!!!!<BR>
";
// Content Above

echo "</td></tr></table>";
CloseTable();
include("footer.php");

?>



Back to top Reply with quote
#2   
Telli
Site Admin
Occupation: Self Employed
Age: 46
Gender: Male
Fav. Sports Team: Detroit Red Wings
Website:
Status: Offline
Joined: May 26, 2003
1.03 posts per day
Posts: 8089
Points: 494,430
   
Just like your including the header and the footer:


include('path/to/my/file.php');




_________________
The path of the righteous man is beset on all sides by the inequities of the selfish and the tyranny of evil men. Blessed is he, who in the name of charity and good will, shepherds the weak through the valley of darkness, for he is truly his brother's keeper and the finder of lost children. And I will strike down upon thee with great vengeance and furious anger those who would attempt to poison and destroy my brothers. And you will know my name is the Lord when I lay my vengeance upon thee. Ezekiel 25:17
Back to top Reply with quote
#3   re: Is it possible to run PHP Scripts in Modules?
ubernvs
CZ Newbie
ubernvs has been a member for over 17 year's 17 Year Member
Gender: Male
Status: Offline
Joined: Feb 06, 2007
0.00 posts per day
Posts: 2
Points: 0
   
so simple lol... thanks for the help.



Back to top Reply with quote
Display posts from previous:      
Add To: Del.icio.us  Digg  Google  Spurl  Blink  Furl  Y! MyWeb  
<< View previous topic View next topic >>
Post new topicReply to topic

Jump to 
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
You cannot attach files in this forum
You cannot download files in this forum