+ Reply to Thread
Results 1 to 2 of 2

Thread: Posting to PHP Modules

  1. #1
    cosmicsafari's Avatar
    cosmicsafari is offline x10Hosting Member cosmicsafari is an unknown quantity at this point
    Join Date
    May 2008
    Location
    Scotland
    Posts
    10

    Posting to PHP Modules

    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 by cosmicsafari; 09-08-2008 at 05:24 AM.
    "Knowledge speaks, but wisdom listens."
    Jimi Hendrix

  2. #2
    Scoochi2's Avatar
    Scoochi2 is offline x10 Sophmore Scoochi2 is an unknown quantity at this point
    Join Date
    Aug 2008
    Location
    Southport!
    Posts
    185

    Re: Posting to PHP Modules

    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 by Scoochi2; 09-08-2008 at 06:27 AM. Reason: Automerged Doublepost
    If anyone can see it, my post was meant for anyone who reads it. Don't take it personally or think I'm being condescending... :nuts:

+ Reply to Thread

Similar Threads

  1. Ever Been Suspended For Using PHP?
    By dragoneye_xp in forum Off Topic
    Replies: 26
    Last Post: 08-16-2009, 07:17 PM
  2. [PHP] Variables in PHP
    By Bryon in forum Tutorials
    Replies: 15
    Last Post: 01-29-2009, 09:46 AM
  3. Places to learn php
    By JaWasabi in forum Scripts & 3rd Party Apps
    Replies: 9
    Last Post: 01-13-2009, 02:03 AM
  4. PHP Easter Eggs
    By dragoneye_xp in forum Off Topic
    Replies: 3
    Last Post: 06-14-2006, 05:48 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
x10hosting free hosting for the masses
dedicated servers