You are missing our premiere tool bar navigation system! Register and use it for FREE!

NukeCops  
•  Home •  Downloads •  Gallery •  Your Account •  Forums • 
Readme First
- Readme First! -

Read and follow the rules, otherwise your posts will be closed
Modules
· Home
· FAQ
· Buy a Theme
· Advertising
· AvantGo
· Bookmarks
· Columbia
· Community
· Donations
· Downloads
· Feedback
· Forums
· PHP-Nuke HOWTO
· Private Messages
· Search
· Statistics
· Stories Archive
· Submit News
· Surveys
· Theme Gallery
· Top
· Topics
· Your Account
Who's Online
There are currently, 398 guest(s) and 0 member(s) that are online.

You are Anonymous user. You can register for free by clicking here
How to display HTML forms in a module

21.12. How to display HTML forms in a module

When you have HTML forms in a module, you may run into problems with passing the values from the form fields to the module itself. Here is just a simple form that you can use as a starting point for your own module with forms - just make a folder named Testing (for instance) in your modules folder, and put an index.php in it with the following code (see File doesn't exist error when posting with a form):

<?php
if (!eregi("modules.php", $PHP_SELF)) {
  die ("You can't access this file directly...");
}
require_once("mainfile.php");
include("header.php");
$module_name = basename(dirname(__FILE__));
echo "<center><form action=\"modules.php?name=$module_name\" method=\"post\"> "
."Name: <input type=\"text\" name=\"yourname\" size=\"20\" 
  value=\"$yourname\">&nbsp;&nbsp;"
."<input type=\"hidden\" name=\"test_input\" value=\"test is good\">"
."<input type=\"submit\" value=\"Submit\"></form></center>";
if($test_input != "") {
  echo "<br>Form worked, and yourname is $yourname";
}
include("footer.php");
?>
Powered by TOGETHER TEAM srl ITALY http://www.togetherteam.it - DONDELEO E-COMMERCE http://www.DonDeLeo.com - TUTTISU E-COMMERCE http://www.tuttisu.it
Web site engine's code is Copyright © 2002 by PHP-Nuke. All Rights Reserved. PHP-Nuke is Free Software released under the GNU/GPL license.
Page Generation: 0.304 Seconds - 214 pages served in past 5 minutes. Nuke Cops Founded by Paul Laudanski (Zhen-Xjell)
:: FI Theme :: PHP-Nuke theme by coldblooded (www.nukemods.com) ::