MyBB Community Forums

Full Version: MyBB Forms
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
How exactly would I deal with a form on a different page?
I need to make a form, that I can load a list of names from the database and format in a dropdown list. However, I basically have a template for a form I could use... I just don't know how to go about putting it in a page by itself...
Did you included ./global.php in your page ?
Yep.
"Fatal error: Class 'Form' not found"
The page I was using as a template was from an ACP page. So I'm not sure if it's supposed to be coded differently or what... I only used a ACP page as a template, as it was the easiest thing to try...
the ACP is a different animal and cannot be used for regular pages.
So does a normal Page require a template from the Plugin's install?
I can make the page with a template, I'm just not really sure how to make a drop down box with items from the DB
Here's an example for getting groups as a drop down box:

$query = $db->query("SELECT * FROM ".TABLE_PREFIX."usergroups");
while($group = $db->fetch_array($query)) {
	$groupselect .= "<option value=\"".$group['gid']."\">".$group['title']."</option>";
}
$groupselect = "<select name='groups'>".$groupselect."</select>";

$groupselect would be the the drop down box, you can just modify that to do what you need.

Regards,
Jammerx2
(2011-03-17, 05:34 AM)Jammerx2 Wrote: [ -> ]Here's an example for getting groups as a drop down box:

$query = $db->query("SELECT * FROM ".TABLE_PREFIX."usergroups");
while($group = $db->fetch_array($query)) {
	$groupselect .= "<option value=\"".$group['gid']."\">".$group['title']."</option>";
}
$groupselect = "<select name='groups'>".$groupselect."</select>";

$groupselect would be the the drop down box, you can just modify that to do what you need.

Regards,
Jammerx2
Thank you very much, I believe I know how to do this now. And I'll give it a try.