Posting to PHP Modules

cosmicsafari

New Member
Messages
10
Reaction score
0
Points
0
Hey all,

Im in the process of trying to add a search option to my website, I was hoping to post the parameters from my webform to a php module ie.

action="view.php?module=search"

is this even possible?

Thanks in advance :happysad:
 
Last edited:

Scoochi2

New Member
Messages
185
Reaction score
0
Points
0
I'm not sure what you're asking.
If the module is installed, it should work by default...

However, if you're trying to pass parameters to your PHP script, you can use the GET commands.

In which case, you could do the following:
Code:
if (isset($_GET['action']))
$action = $_GET['action'];

if (isset($_GET['module']))
$module = $_GET['module'];
Then if somebody accesses that page via the URL myscript.php?action=view&module=search
then the values for $action and $module will become 'view' and 'search'.
I do not recommend using 'view.php', then including that file (or w/e).
Use the following instead:
Code:
if (!file_exists("pages/$action.php"))
$action = '404';

require_once ("pages/$action.php");
Edit:
See here for more info.
 
Last edited:
Top