Jump to content


This topic is now archived and is closed to further replies.


sending form data to an external function

Recommended Posts

Hi everybody!
I'm trying to send some form data to a different page where I have all my site's functions.
My form page it's like this:

<form  method="post" action="functions.php?action=checkgroup"> /* is this action right? */
Group Name: <input type="text" name="group">
<input  type="submit" name="submit" value="check">

Then, in my functions.php page:

function checkgroup(whattheheckshouldIputinhere?){

sql stuff...

return something..


Well , so what am I missing? is it something related to GET action and stuff?
If anybody can give me a hand I'd appreciate it!
(and my register_globas is on)

Share this post

Link to post
Share on other sites
Almost there...

Probably best to have your functions page as just that, nothing else.  Then include it in the rest of your pages.  So your form calls validate.php which looks a little like this.

  $group = $_GET['group'];


Share this post

Link to post
Share on other sites
The way we do it on my server is we have an index.php page which runs all of our Posts.  As HuggieBear said you need to include your functions page with in the other pages.  Then have your form Post to your index.php.  On you index.php have something like this...

if (isset$_POST['submit']){
$var = $_POST['submit'];

On your page of functions you should have your check group function look something like this...

function checkgroup($group){

ALL THE CODE YOU WANT...  $group now equals $var from above.


I hope I explained it well.  Good Luck

Share this post

Link to post
Share on other sites


Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.