PHP Web Host - Quality Web Hosting For All PHP Applications $35/month $250/year (Unlimited) - $25/month - 200,000 impressions - Your Ad Could be Here - Click For Details
  Login or Register
 • Home • Downloads • Your Account • Forums • 

View next topic
View previous topic


Google
 
Web RavenPHPScripts (This Site)
Post new topic   Reply to topic
Author Message
thundarfoot
Regular
Regular


Joined: Jan 16, 2008
Posts: 75

PostPosted: Mon Feb 04, 2008 4:40 pm Reply with quote Back to top

I need some help with developing a module/block combo. I dont know what I am doing, and I am a noob...that said here goes.

I have a block that I have made with the wysiwyg editor which contains this code.

Code:
<form onsubmit="this.submit.disabled=\'true\'" action="modules.php?name=My_Module" method="post">
<form id="form1" name="form1" method="post" action="">
  <strong><b>Choose File</strong></b>
  <select name="select">
<option value="http://localhost/raven/modules/My_Module/1.php">File 1</option>
<option value="http://localhost/raven/modules/My_Module/2.php">File 2</option>
  </select>
  <input type="submit" name="submit" value="submit">
</form>


I have a module dir called My_Module inside this folder I have 3 files
index.php (mostly blank)
1.php
2.php (both 1 & 2 are simple query database display scripts that work outside nuke)

the module is active in the admin panel, and it appears like when I click submit the module index.php is loading. not the files I am trying to call.

I have this code at the top of all files.
Code:
if (!defined('MODULE_FILE')) die('You can\'t access this file directly...');
require_once('mainfile.php');
require_once('../Connections/LWC.php');
$module_name = basename(dirname(__FILE__));
get_lang($module_name);
$pagetitle = '- You Module Name'; // If you need this to be multi-lingual then you will have to use language defines
include_once 'header.php';
OpenTable();


thank you in advance for any help you can lend
View user's profile Send private message
evaders99
Former Moderator in Good Standing


Joined: Apr 30, 2004
Posts: 3221

PostPosted: Mon Feb 04, 2008 4:56 pm Reply with quote Back to top

I assume somewhere modules/My_Module/index.php takes whatever the $select variable from the import form and processes that?
I don't understand why you need the full path to it either...
ie
Code:

http://localhost/raven/modules/My_Module/1.php


You could just pass a value (1 or 2) and then index.php needs to include it
Code:

if ($select == 1) include('1.php');
...


Or a better way would just be to use the built-in file parameters of phpNuke
Code:

use

<select name="file">
<option value="1">File 1</option>

and then it should pass the file variable so that it opens correctly in the form
modules.php?name=My_Module&file=1
which opens 1.php
View user's profile Send private message Visit poster's website
thundarfoot
Regular
Regular


Joined: Jan 16, 2008
Posts: 75

PostPosted: Mon Feb 04, 2008 7:37 pm Reply with quote Back to top

Actually no my index.php file is blank, I really dont think I need it? I just need to be able to load the files I want based on the choice in the box (a menu like).

using the select name = file instead of submit and changing the value to the file name without the .php extension, seems to be working thank you very much for your example, and your time.
View user's profile Send private message
evaders99
Former Moderator in Good Standing


Joined: Apr 30, 2004
Posts: 3221

PostPosted: Tue Feb 05, 2008 12:21 am Reply with quote Back to top

Why duplicate what phpNuke does already Smile
Glad you got it working
View user's profile Send private message Visit poster's website
thundarfoot
Regular
Regular


Joined: Jan 16, 2008
Posts: 75

PostPosted: Tue Feb 05, 2008 2:03 am Reply with quote Back to top

I appreciate all the help I have recived and fully plan to choose raven as my host once I have finished building and secured a domain name.
View user's profile Send private message
Display posts from previous:       
Post new topic   Reply to topic

View next topic
View previous topic
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
Forums ©
 

All logos and trademarks in this site are property of their respective owner.
The comments are property of their posters, all the rest © 2002-2011 by Raven

You can syndicate our news using the file xml

CSE HTML Validator Helped Clean up This Page! [Valid RSS] valid RSS 2.0 Valid robots.txt Stop Spam Harvesters, Join Project Honey Pot

Website engines core code is © copyright by PHP-Nuke but has been heavily patched and modified by myself and others.
PHP-Nuke is a free software released under the GNU/GPL.


:: fisubice phpbb2 style by Daz :: PHP-Nuke theme by www.nukemods.com ::
:: fisubice Theme Modified by the RavenNuke™ Team ::

:: W3C CSS Compliance Validation :: W3C HTML 4.01 Transitional Compliance Validation ::

zerosum