Ravens PHP Scripts: Forums
 

 

View next topic
View previous topic
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Ravens PHP Scripts And Web Hosting Forum Index -> Raven's RavenNuke(tm) v2.00.00 - v2.02.00 Distro
Author Message
thejackal
Regular
Regular


Joined: Jul 26, 2006
Posts: 52

PostPosted: Fri Dec 22, 2006 10:45 am Reply with quote

The mainfile.php uses several variables.

$name would hold the module name such as "Journal".
I can see the then value of $name equal to Journal by echoing out the variable name.

But lets say I wanted to drill down futher in the name.

Lets say I want to edit my Journal for example: modules.php?name=Journal&file=editmodules.php?name=Journal&file=edit

or I wanted to add a Journal entry
modules.php?name=Journal&file=add

I know that $name holds the module part "Journal" but what if I want to get the remainder of the link.

The "edit" or file"

So in the modules.php?name=Journal&file=edit


$name = Journal

but what variable would hold the "edit" or "add" so I could capture that variable?

I am trying to capture or drill down futher from the module name and get the actiual content it is executing.


Hope I explained it good enough to understand.

Thanks in advance...
 
View user's profile Send private message
Guardian2003
Site Admin


Joined: Aug 28, 2003
Posts: 6792
Location: Ha Noi, Viet Nam

PostPosted: Fri Dec 22, 2006 11:52 am Reply with quote

I don't undertstand what you are trying to do but anything further than the module name will load a fucntion within that module provided you have the permission (user or admin) to execute that function.
Additionally, there are security checks in place to ensure functions are loaded only within the module itself and it would be most unwise to even attempt to change that.
 
View user's profile Send private message Send e-mail
thejackal
PostPosted: Fri Dec 22, 2006 12:16 pm Reply with quote

Let me try again, it is hard to explain....

If I click Journal I will see the following:
journal.html?file=editjournal.html?file=edit

or

faq.html

Lets say I want to print out the above link using echo

I know in the mainfile.php $name will hold "Journal"

or it will hold "News"


So if I echo $name I will see "Journal" or "News" depeding on which link I clicked.

Is there a global variable that holds the the functions. So lets say I set and echo $function for example:

in the journal.html?file=editjournal.html?file=edit is there a global varible that holds the function to the module?

For example I did the following:

echo $name = "Journal"
echo $function = "edit"
so on ....

I am hoping there is a global variable or a way to set one to parse out the entire line and break it into seperate variables.
 
Guardian2003
PostPosted: Fri Dec 22, 2006 12:37 pm Reply with quote

Yes but its only available within the module.
Its usually $op but if you search the modules index.php file for 'switch' you should find it.
The value of the variable is usually either set to a default value of null
Code:
if(!isset($op)) $op='';

unless the module sets its own default value which would be the name of the function loaded by default.

So if you tried to echo the value out in mainfile, it would return nothing unless you click on a link to take you to a specific module (except perhaps if the module is loaded 'in home').

It might be easier for you to see whats happening if you turn your url re-writing off.
You do not want to be creating new global variables unless you absolutely have to as once created they are available throughout nuke which means it may be possible to inject the variable into a crafted url string with some diasterous results.
 
thejackal
PostPosted: Fri Dec 22, 2006 1:13 pm Reply with quote

Thanks that gave me exactly what I needed. It seems everything just before the = is a variable and can be captued.
 
fkelly
Former Moderator in Good Standing


Joined: Aug 30, 2005
Posts: 3312
Location: near Albany NY

PostPosted: Fri Dec 22, 2006 8:08 pm Reply with quote

Read up on gets. There are two basic means that web programs use to communicate with each other ... post and gets. Gets do what you are referring to above, generally what is put in them is based on user response and then the "receiving" program decodes them and takes an action based on the contents. You can see examples within the Nuke code but you'd be better off reading some basic explanations first.
 
View user's profile Send private message Visit poster's website
Display posts from previous:       
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Ravens PHP Scripts And Web Hosting Forum Index -> Raven's RavenNuke(tm) v2.00.00 - v2.02.00 Distro

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
You can attach files in this forum
You can download files in this forum


Powered by phpBB © 2001-2007 phpBB Group
All times are GMT - 6 Hours
 
Forums ©