sending form data to an external function
Posted 12 September 2006 - 06:25 PM
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:
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)
Posted 12 September 2006 - 06:29 PM
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.
<?php include_once('functions.php'); $group = $_GET['group']; checkgroup($group); ?>
Links: PHP Docs :: RegEx's :: MySQL :: DevGuru :: w3schools
Posted 12 September 2006 - 06:36 PM
$var = $_POST['submit'];
On your page of functions you should have your check group function look something like this...
ALL THE CODE YOU WANT... $group now equals $var from above.
I hope I explained it well. Good Luck
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users