| Author |
Message |
digatle

Joined: Feb 07, 2006
Posts: 13
|
Posted:
Thu Mar 23, 2006 12:15 pm |
|
I've got two forms I'm trying to combine in phpNuke and I'm following the code simular to that from Your_Account with the functions.
I can get the page to load, somewhat <puzzled look>.
I named the function twohg so my link should be that of:
modules=Forms&op=twohg
The only thing I get is the beginning of my page and an OpenTable. It's like the function doesn't even exist. Here's a small snippet of what twohg looks like.
| Code: |
OpenTable();
function twohg() {
echo"<html><center><font color=\"red\"<b>Two Headed Giant Team - 2HG</b></font><br><br>Please use this form when creating your team.<br>This form does not put you into any open leagues, this only registers your account with the system.<br></center>";
CloseTable();
OpenTable();
echo""
. "<center><br>"
. "<form method=\"post\" enctype=\"multipart/form-data\" action=\"formmail.php\">" |
Have I messed something up or not called something right? |
| |
|
|
 |
gotcha
Site Admin


Joined: Oct 25, 2004
Posts: 756
|
Posted:
Thu Mar 23, 2006 2:08 pm |
|
You would have to post the whole.. I can't really tell if the function is called somewhere on the page. |
| |
|
|
 |
digatle

Joined: Feb 07, 2006
Posts: 13
|
Posted:
Thu Mar 23, 2006 5:09 pm |
|
I can do that.
| Code: |
<?php
if (!eregi("modules.php", $PHP_SELF)) {
die ("You can't access this file directly...");
}
require_once("mainfile.php");
$module_name = basename(dirname(__FILE__));
get_lang($module_name);
include("header.php");
$index = 0;
cookiedecode($user);
$username = $cookie[1];
$result = $db->sql_query("SELECT user_email FROM ".$user_prefix."_users WHERE username='$username'");
list($user_email) = $db->sql_fetchrow($result);
OpenTable();
function twohg() {
echo"<html><center><font color=\"red\"<b>Two Headed Giant Team - 2HG</b></font><br><br>Please use this form when creating your team.<br>This form does not put you into any open leagues, this only registers your account with the system.<br></center>";
CloseTable();
OpenTable();
echo""
. "<center><br>"
. "<form method=\"post\" enctype=\"multipart/form-data\" action=\"formmail.php\">"
. "<input type=\"hidden\" name=\"path_to_file\" value=\"/var/www/html/formmail\">"
. "<input type=\"hidden\" name=\"require\" value=\"TeamName, PlayerA, PlayerB, OnlineTime\">"
. "<input type=\"hidden\" name=\"sort\" value=\"alphabetic\">"
. "<input type=\"hidden\" name=\"subject\" value=\"NEW: 2HG Team Registration.\">"
. "<input type=\"hidden\" name=\"env_report\" value=\"REMOTE_HOST,HTTP_USER_AGENT\">"
. "<input type=\"hidden\" name=\"Commissioner\" value=\"$username\">"
. "<input type=\"hidden\" name=\"Email\" value=\"$user_email\">"
. "<table width=\"50%\"><b>Note: The Person who is in Player A's position will be Captain of their team.</b><br><br>"
. "<td>What do you want your team name to be?</td>"
. " <td>"
. " <input type=text size=\"30\" name=\"TeamName\">"
. " </td>"
. "</tr>"
. "<td>MTGO Screen Name of Player A?</td>"
. " <td>"
. " <input type=text size=\"30\" name=\"PlayerA\">"
. " </td>"
. "</tr>"
. "<td>MTGO Screen Name of Player B?</td>"
. " <td>"
. " <input type=text size=\"30\" name=\"PlayerB\">"
. " </td>"
. "</tr>"
. "<tr>"
. "<td>If <b>both</b> players represent a single clan, what clan do you represent?</td>"
. " <td>"
. " <input type=text size=\"30\" name=\"Clan's Name\">"
. " </td>"
. "</tr>"
. "<tr>"
. "<td>During what time period is the Captain (Player A) generally online so that we may contact you for the final process?</td>"
. " <td>"
. " <textarea cols=\"25\" rows=\"4\" name=\"OnlineTime\"></textarea>"
. " </td>"
. "</tr>"
. ""
. ""
. "<td></td>"
. "<td colspan=\"2\"><input type=\"submit\"><input type=\"reset\"></td>"
. "</tr>"
. "</table>"
. "</form>"
. "</center>"
. "</html>";
}
CloseTable();
include("footer.php");
?>
|
I haven't added the other functions yet because I can't get even one done. So I figured if I get one working I can do it again. |
| |
|
|
 |
gotcha
Site Admin


Joined: Oct 25, 2004
Posts: 756
|
Posted:
Thu Mar 23, 2006 6:13 pm |
|
You are pretty close.. scroll down to see what i added
| Code: |
<?php
if (!eregi("modules.php", $PHP_SELF)) {
die ("You can't access this file directly...");
}
require_once("mainfile.php");
$module_name = basename(dirname(__FILE__));
get_lang($module_name);
include("header.php");
$index = 0;
cookiedecode($user);
$username = $cookie[1];
$result = $db->sql_query("SELECT user_email FROM ".$user_prefix."_users WHERE username='$username'");
list($user_email) = $db->sql_fetchrow($result);
OpenTable();
function twohg() {
echo"<html><center><font color=\"red\"<b>Two Headed Giant Team - 2HG</b></font><br><br>Please use this form when creating your team.<br>This form does not put you into any open leagues, this only registers your account with the system.<br></center>";
CloseTable();
OpenTable();
echo""
. "<center><br>"
. "<form method=\"post\" enctype=\"multipart/form-data\" action=\"formmail.php\">"
. "<input type=\"hidden\" name=\"path_to_file\" value=\"/var/www/html/formmail\">"
. "<input type=\"hidden\" name=\"require\" value=\"TeamName, PlayerA, PlayerB, OnlineTime\">"
. "<input type=\"hidden\" name=\"sort\" value=\"alphabetic\">"
. "<input type=\"hidden\" name=\"subject\" value=\"NEW: 2HG Team Registration.\">"
. "<input type=\"hidden\" name=\"env_report\" value=\"REMOTE_HOST,HTTP_USER_AGENT\">"
. "<input type=\"hidden\" name=\"Commissioner\" value=\"$username\">"
. "<input type=\"hidden\" name=\"Email\" value=\"$user_email\">"
. "<table width=\"50%\"><b>Note: The Person who is in Player A's position will be Captain of their team.</b><br><br>"
. "<td>What do you want your team name to be?</td>"
. " <td>"
. " <input type=text size=\"30\" name=\"TeamName\">"
. " </td>"
. "</tr>"
. "<td>MTGO Screen Name of Player A?</td>"
. " <td>"
. " <input type=text size=\"30\" name=\"PlayerA\">"
. " </td>"
. "</tr>"
. "<td>MTGO Screen Name of Player B?</td>"
. " <td>"
. " <input type=text size=\"30\" name=\"PlayerB\">"
. " </td>"
. "</tr>"
. "<tr>"
. "<td>If <b>both</b> players represent a single clan, what clan do you represent?</td>"
. " <td>"
. " <input type=text size=\"30\" name=\"Clan's Name\">"
. " </td>"
. "</tr>"
. "<tr>"
. "<td>During what time period is the Captain (Player A) generally online so that we may contact you for the final process?</td>"
. " <td>"
. " <textarea cols=\"25\" rows=\"4\" name=\"OnlineTime\"></textarea>"
. " </td>"
. "</tr>"
. ""
. ""
. "<td></td>"
. "<td colspan=\"2\"><input type=\"submit\"><input type=\"reset\"></td>"
. "</tr>"
. "</table>"
. "</form>"
. "</center>"
. "</html>";
}
twohg(); // ADDED - this calls the function
CloseTable();
include("footer.php");
?>
|
I haven't added the other functions yet because I can't get even one done. So I figured if I get one working I can do it again.[/quote] |
| |
|
|
 |
digatle

Joined: Feb 07, 2006
Posts: 13
|
Posted:
Thu Mar 23, 2006 6:32 pm |
|
So I do this with each function? How do I set the primary screen function, meaning, when they click on Forms I want it to list the available forms? Then those become &op=twohg and so forth? |
| |
|
|
 |
gotcha
Site Admin


Joined: Oct 25, 2004
Posts: 756
|
Posted:
Thu Mar 23, 2006 10:14 pm |
|
no, to have more than 1 function you would do something like this...
| Code: |
<?php
if (!eregi("modules.php", $PHP_SELF)) {
die ("You can't access this file directly...");
}
require_once("mainfile.php");
$module_name = basename(dirname(__FILE__));
get_lang($module_name);
include("header.php");
$index = 0;
cookiedecode($user);
$username = $cookie[1];
$result = $db->sql_query("SELECT user_email FROM ".$user_prefix."_users WHERE username='$username'");
list($user_email) = $db->sql_fetchrow($result);
OpenTable();
function twohg() {
echo"<html><center><font color=\"red\"<b>Two Headed Giant Team - 2HG</b></font><br><br>Please use this form when creating your team.<br>This form does not put you into any open leagues, this only registers your account with the system.<br></center>";
CloseTable();
OpenTable();
echo""
. "<center><br>"
. "<form method=\"post\" enctype=\"multipart/form-data\" action=\"formmail.php\">"
. "<input type=\"hidden\" name=\"path_to_file\" value=\"/var/www/html/formmail\">"
. "<input type=\"hidden\" name=\"require\" value=\"TeamName, PlayerA, PlayerB, OnlineTime\">"
. "<input type=\"hidden\" name=\"sort\" value=\"alphabetic\">"
. "<input type=\"hidden\" name=\"subject\" value=\"NEW: 2HG Team Registration.\">"
. "<input type=\"hidden\" name=\"env_report\" value=\"REMOTE_HOST,HTTP_USER_AGENT\">"
. "<input type=\"hidden\" name=\"Commissioner\" value=\"$username\">"
. "<input type=\"hidden\" name=\"Email\" value=\"$user_email\">"
. "<table width=\"50%\"><b>Note: The Person who is in Player A's position will be Captain of their team.</b><br><br>"
. "<td>What do you want your team name to be?</td>"
. " <td>"
. " <input type=text size=\"30\" name=\"TeamName\">"
. " </td>"
. "</tr>"
. "<td>MTGO Screen Name of Player A?</td>"
. " <td>"
. " <input type=text size=\"30\" name=\"PlayerA\">"
. " </td>"
. "</tr>"
. "<td>MTGO Screen Name of Player B?</td>"
. " <td>"
. " <input type=text size=\"30\" name=\"PlayerB\">"
. " </td>"
. "</tr>"
. "<tr>"
. "<td>If <b>both</b> players represent a single clan, what clan do you represent?</td>"
. " <td>"
. " <input type=text size=\"30\" name=\"Clan's Name\">"
. " </td>"
. "</tr>"
. "<tr>"
. "<td>During what time period is the Captain (Player A) generally online so that we may contact you for the final process?</td>"
. " <td>"
. " <textarea cols=\"25\" rows=\"4\" name=\"OnlineTime\"></textarea>"
. " </td>"
. "</tr>"
. ""
. ""
. "<td></td>"
. "<td colspan=\"2\"><input type=\"submit\"><input type=\"reset\"></td>"
. "</tr>"
. "</table>"
. "</form>"
. "</center>"
. "</html>";
}
// ADDED
switch($op){
// this will execute modules.php?name=Forms&op=twohg
case"twohg":
twohg();
break;
// if no &op=xxxx is in url, this is where it defaults
default:
twohg();
break;
}
CloseTable();
include("footer.php");
?> |
|
| |
|
|
 |
digatle

Joined: Feb 07, 2006
Posts: 13
|
Posted:
Thu Mar 23, 2006 10:17 pm |
|
OK I'll be playing with this all tomorrow (givin' I have time). I appreciate all the help. I'll let you know how it turns out.
Thomas |
| |
|
|
 |
digatle

Joined: Feb 07, 2006
Posts: 13
|
Posted:
Fri Mar 24, 2006 5:42 pm |
|
OK I've done something wrong here cause all of the options show up and not the way I need it. You can see it with this link:
http://www.shadowsofsanctuary.com/html/modules.php?name=Forms
Here's my code. What have I screwed up? Also, where and how do I create the "main menu" for this page too? I'm a little confused on that part as well.
| Code: |
<?php
if (!eregi("modules.php", $PHP_SELF)) {
die ("You can't access this file directly...");
}
require_once("mainfile.php");
$module_name = basename(dirname(__FILE__));
get_lang($module_name);
include("header.php");
$index = 0;
cookiedecode($user);
$username = $cookie[1];
$result = $db->sql_query("SELECT user_email FROM ".$user_prefix."_users WHERE username='$username'");
list($user_email) = $db->sql_fetchrow($result);
OpenTable();
// Single Player Function
function spt() {
echo"<html><center><font color=\"red\"<b>Single Player Team - SPT</b></font><br><br>Please use this form when creating your Single Player Team (SPT).<br>This form does not put you into any open leagues, this only registers your account with the system.<br></center>";
CloseTable();
OpenTable();
echo""
. "<center><br>"
. "<form method=\"post\" enctype=\"multipart/form-data\" action=\"formmail.php\">"
. "<input type=\"hidden\" name=\"path_to_file\" value=\"/var/www/html/formmail\">"
. "<input type=\"hidden\" name=\"require\" value=\"MTGOScreenname, OnlineTime\">"
. "<input type=\"hidden\" name=\"sort\" value=\"alphabetic\">"
. "<input type=\"hidden\" name=\"subject\" value=\"NEW: Single Player Team Registration.\">"
. "<input type=\"hidden\" name=\"env_report\" value=\"REMOTE_HOST,HTTP_USER_AGENT\">"
. "<input type=\"hidden\" name=\"Commissioner\" value=\"$username\">"
. "<input type=\"hidden\" name=\"Email\" value=\"$user_email\">"
. "<table width=\"50%\">"
. "<td>What is your MTGO Screen Name?</td>"
. " <td>"
. " <input type=text size=\"30\" name=\"MTGOScreenname\">"
. " </td>"
. "</tr>"
. "<tr>"
. "<td>If you represent a clan, what clan do you represent?</td>"
. " <td>"
. " <input type=text size=\"30\" name=\"Clan's Name\">"
. " </td>"
. "</tr>"
. "<tr>"
. "<td>During what time period are you generally online so that we may contact you for the final process?</td>"
. " <td>"
. " <textarea cols=\"25\" rows=\"4\" name=\"OnlineTime\"></textarea>"
. " </td>"
. "</tr>"
. ""
. ""
. "<td></td>"
. "<td colspan=\"2\"><input type=\"submit\"><input type=\"reset\"></td>"
. "</tr>"
. "</table>"
. "</form>"
. "</center>"
. "</html>";
}
spt();
// Two Headed Giant Function
function twohg() {
echo"<html><center><font color=\"red\"<b>Two Headed Giant Team - 2HG</b></font><br><br>Please use this form when creating your team.<br>This form does not put you into any open leagues, this only registers your account with the system.<br></center>";
CloseTable();
OpenTable();
echo""
. "<center><br>"
. "<form method=\"post\" enctype=\"multipart/form-data\" action=\"formmail.php\">"
. "<input type=\"hidden\" name=\"path_to_file\" value=\"/var/www/html/formmail\">"
. "<input type=\"hidden\" name=\"require\" value=\"TeamName, PlayerA, PlayerB, OnlineTime\">"
. "<input type=\"hidden\" name=\"sort\" value=\"alphabetic\">"
. "<input type=\"hidden\" name=\"subject\" value=\"NEW: 2HG Team Registration.\">"
. "<input type=\"hidden\" name=\"env_report\" value=\"REMOTE_HOST,HTTP_USER_AGENT\">"
. "<input type=\"hidden\" name=\"Commissioner\" value=\"$username\">"
. "<input type=\"hidden\" name=\"Email\" value=\"$user_email\">"
. "<table width=\"50%\"><b>Note: The Person who is in Player A's position will be Captain of their team.</b><br><br>"
. "<td>What do you want your team name to be?</td>"
. " <td>"
. " <input type=text size=\"30\" name=\"TeamName\">"
. " </td>"
. "</tr>"
. "<td>MTGO Screen Name of Player A?</td>"
. " <td>"
. " <input type=text size=\"30\" name=\"PlayerA\">"
. " </td>"
. "</tr>"
. "<td>MTGO Screen Name of Player B?</td>"
. " <td>"
. " <input type=text size=\"30\" name=\"PlayerB\">"
. " </td>"
. "</tr>"
. "<tr>"
. "<td>If <b>both</b> players represent a single clan, what clan do you represent?</td>"
. " <td>"
. " <input type=text size=\"30\" name=\"Clan's Name\">"
. " </td>"
. "</tr>"
. "<tr>"
. "<td>During what time period is the Captain (Player A) generally online so that we may contact you for the final process?</td>"
. " <td>"
. " <textarea cols=\"25\" rows=\"4\" name=\"OnlineTime\"></textarea>"
. " </td>"
. "</tr>"
. ""
. ""
. "<td></td>"
. "<td colspan=\"2\"><input type=\"submit\"><input type=\"reset\"></td>"
. "</tr>"
. "</table>"
. "</form>"
. "</center>"
. "</html>";
}
twohg();
function threehg() {
echo"<html><center><font color=\"red\"<b>Three Headed Giant Team - 3HG</b></font><br><br>Please use this form when creating your team.<br>This form does not put you into any open leagues, this only registers your account with the system.<br></center>";
CloseTable();
OpenTable();
echo""
. "<center><br>"
. "<form method=\"post\" enctype=\"multipart/form-data\" action=\"formmail.php\">"
. "<input type=\"hidden\" name=\"path_to_file\" value=\"/var/www/html/formmail\">"
. "<input type=\"hidden\" name=\"require\" value=\"TeamName, PlayerA, PlayerB, PlayerC, OnlineTime\">"
. "<input type=\"hidden\" name=\"sort\" value=\"alphabetic\">"
. "<input type=\"hidden\" name=\"subject\" value=\"NEW: 3HG Team Registration.\">"
. "<input type=\"hidden\" name=\"env_report\" value=\"REMOTE_HOST,HTTP_USER_AGENT\">"
. "<input type=\"hidden\" name=\"Commissioner\" value=\"$username\">"
. "<input type=\"hidden\" name=\"Email\" value=\"$user_email\">"
. "<table width=\"50%\"><b>Note: The Person who is in Player A's position will be Captain of their team.</b><br><br>"
. "<td>What do you want your team name to be?</td>"
. " <td>"
. " <input type=text size=\"30\" name=\"TeamName\">"
. " </td>"
. "</tr>"
. "<td>MTGO Screenname of Player A?</td>"
. " <td>"
. " <input type=text size=\"30\" name=\"PlayerA\">"
. " </td>"
. "</tr>"
. "<td>MTGO Screenname of Player B?</td>"
. " <td>"
. " <input type=text size=\"30\" name=\"PlayerB\">"
. " </td>"
. "</tr>"
. "<td>MTGO Screenname of Player C?</td>"
. " <td>"
. " <input type=text size=\"30\" name=\"PlayerC\">"
. " </td>"
. "</tr>"
. "<tr>"
. "<td>If <b>all</b> players represent a single clan, what clan do you represent?</td>"
. " <td>"
. " <input type=text size=\"30\" name=\"Clan's Name\">"
. " </td>"
. "</tr>"
. "<tr>"
. "<td>During what time period is the Captain (Player A) generally online so that we may contact you for the final process?</td>"
. " <td>"
. " <textarea cols=\"25\" rows=\"4\" name=\"OnlineTime\"></textarea>"
. " </td>"
. "</tr>"
. ""
. ""
. "<td></td>"
. "<td colspan=\"2\"><input type=\"submit\"><input type=\"reset\"></td>"
. "</tr>"
. "</table>"
. "</form>"
. "</center>"
. "</html>";
}
threehg();
CloseTable();
include("footer.php");
?> |
Thank you again for all the help. |
| |
|
|
 |
gotcha
Site Admin


Joined: Oct 25, 2004
Posts: 756
|
Posted:
Fri Mar 24, 2006 6:15 pm |
|
you are using the first example i gave you... use the second one as the starting point |
| |
|
|
 |
digatle

Joined: Feb 07, 2006
Posts: 13
|
Posted:
Fri Mar 24, 2006 6:53 pm |
|
AHH it worked. So I changed it to home and created a function called home() ... add just an echo test and in fact it worked. Then added the &op=twohg and sure enuf that form came up.
Does the order matter at all by chance? |
| |
|
|
 |
digatle

Joined: Feb 07, 2006
Posts: 13
|
Posted:
Fri Mar 24, 2006 7:06 pm |
|
OK apparently it does cause now I've added the three forms to it and followed your lead and it shows up white regardless of which op= I use.
| Code: |
<?php
if (!eregi("modules.php", $PHP_SELF)) {
die ("You can't access this file directly...");
}
require_once("mainfile.php");
$module_name = basename(dirname(__FILE__));
get_lang($module_name);
include("header.php");
$index = 0;
cookiedecode($user);
$username = $cookie[1];
$result = $db->sql_query("SELECT user_email FROM ".$user_prefix."_users WHERE username='$username'");
list($user_email) = $db->sql_fetchrow($result);
OpenTable();
function start(){
echo "Test";
}
function spt(){
echo"<html><center><font color=\"red\"<b>Single Player Team - SPT</b></font><br><br>Please use this form when creating your Single Player Team (SPT).<br>This form does not put you into any open leagues, this only registers your account with the system.<br></center>";
CloseTable();
OpenTable();
echo""
. "<center><br>"
. "<form method=\"post\" enctype=\"multipart/form-data\" action=\"formmail.php\">"
. "<input type=\"hidden\" name=\"path_to_file\" value=\"/var/www/html/formmail\">"
. "<input type=\"hidden\" name=\"require\" value=\"MTGOScreenname, OnlineTime\">"
. "<input type=\"hidden\" name=\"sort\" value=\"alphabetic\">"
. "<input type=\"hidden\" name=\"subject\" value=\"NEW: Single Player Team Registration.\">"
. "<input type=\"hidden\" name=\"env_report\" value=\"REMOTE_HOST,HTTP_USER_AGENT\">"
. "<input type=\"hidden\" name=\"Commissioner\" value=\"$username\">"
. "<input type=\"hidden\" name=\"Email\" value=\"$user_email\">"
. "<table width=\"50%\">"
. "<td>What is your MTGO Screen Name?</td>"
. " <td>"
. " <input type=text size=\"30\" name=\"MTGOScreenname\">"
. " </td>"
. "</tr>"
. "<tr>"
. "<td>If you represent a clan, what clan do you represent?</td>"
. " <td>"
. " <input type=text size=\"30\" name=\"Clan's Name\">"
. " </td>"
. "</tr>"
. "<tr>"
. "<td>During what time period are you generally online so that we may contact you for the final process?</td>"
. " <td>"
. " <textarea cols=\"25\" rows=\"4\" name=\"OnlineTime\"></textarea>"
. " </td>"
. "</tr>"
. ""
. ""
. "<td></td>"
. "<td colspan=\"2\"><input type=\"submit\"><input type=\"reset\"></td>"
. "</tr>"
. "</table>"
. "</form>"
. "</center>"
. "</html>";
}
function twohg() {
echo"<html><center><font color=\"red\"<b>Two Headed Giant Team - 2HG</b></font><br><br>Please use this form when creating your team.<br>This form does not put you into any open leagues, this only registers your account with the system.<br></center>";
CloseTable();
OpenTable();
echo""
. "<center><br>"
. "<form method=\"post\" enctype=\"multipart/form-data\" action=\"formmail.php\">"
. "<input type=\"hidden\" name=\"path_to_file\" value=\"/var/www/html/formmail\">"
. "<input type=\"hidden\" name=\"require\" value=\"TeamName, PlayerA, PlayerB, OnlineTime\">"
. "<input type=\"hidden\" name=\"sort\" value=\"alphabetic\">"
. "<input type=\"hidden\" name=\"subject\" value=\"NEW: 2HG Team Registration.\">"
. "<input type=\"hidden\" name=\"env_report\" value=\"REMOTE_HOST,HTTP_USER_AGENT\">"
. "<input type=\"hidden\" name=\"Commissioner\" value=\"$username\">"
. "<input type=\"hidden\" name=\"Email\" value=\"$user_email\">"
. "<table width=\"50%\"><b>Note: The Person who is in Player A's position will be Captain of their team.</b><br><br>"
. "<td>What do you want your team name to be?</td>"
. " <td>"
. " <input type=text size=\"30\" name=\"TeamName\">"
. " </td>"
. "</tr>"
. "<td>MTGO Screen Name of Player A?</td>"
. " <td>"
. " <input type=text size=\"30\" name=\"PlayerA\">"
. " </td>"
. "</tr>"
. "<td>MTGO Screen Name of Player B?</td>"
. " <td>"
. " <input type=text size=\"30\" name=\"PlayerB\">"
. " </td>"
. "</tr>"
. "<tr>"
. "<td>If <b>both</b> players represent a single clan, what clan do you represent?</td>"
. " <td>"
. " <input type=text size=\"30\" name=\"Clan's Name\">"
. " </td>"
. "</tr>"
. "<tr>"
. "<td>During what time period is the Captain (Player A) generally online so that we may contact you for the final process?</td>"
. " <td>"
. " <textarea cols=\"25\" rows=\"4\" name=\"OnlineTime\"></textarea>"
. " </td>"
. "</tr>"
. ""
. ""
. "<td></td>"
. "<td colspan=\"2\"><input type=\"submit\"><input type=\"reset\"></td>"
. "</tr>"
. "</table>"
. "</form>"
. "</center>"
. "</html>";
}
function threehg() {
echo"<html><center><font color=\"red\"<b>Three Headed Giant Team - 3HG</b></font><br><br>Please use this form when creating your team.<br>This form does not put you into any open leagues, this only registers your account with the system.<br></center>";
CloseTable();
OpenTable();
echo""
. "<center><br>"
. "<form method=\"post\" enctype=\"multipart/form-data\" action=\"formmail.php\">"
. "<input type=\"hidden\" name=\"path_to_file\" value=\"/var/www/html/formmail\">"
. "<input type=\"hidden\" name=\"require\" value=\"TeamName, PlayerA, PlayerB, PlayerC, OnlineTime\">"
. "<input type=\"hidden\" name=\"sort\" value=\"alphabetic\">"
. "<input type=\"hidden\" name=\"subject\" value=\"NEW: 3HG Team Registration.\">"
. "<input type=\"hidden\" name=\"env_report\" value=\"REMOTE_HOST,HTTP_USER_AGENT\">"
. "<input type=\"hidden\" name=\"Commissioner\" value=\"$username\">"
. "<input type=\"hidden\" name=\"Email\" value=\"$user_email\">"
. "<table width=\"50%\"><b>Note: The Person who is in Player A's position will be Captain of their team.</b><br><br>"
. "<td>What do you want your team name to be?</td>"
. " <td>"
. " <input type=text size=\"30\" name=\"TeamName\">"
. " </td>"
. "</tr>"
. "<td>MTGO Screenname of Player A?</td>"
. " <td>"
. " <input type=text size=\"30\" name=\"PlayerA\">"
. " </td>"
. "</tr>"
. "<td>MTGO Screenname of Player B?</td>"
. " <td>"
. " <input type=text size=\"30\" name=\"PlayerB\">"
. " </td>"
. "</tr>"
. "<td>MTGO Screenname of Player C?</td>"
. " <td>"
. " <input type=text size=\"30\" name=\"PlayerC\">"
. " </td>"
. "</tr>"
. "<tr>"
. "<td>If <b>all</b> players represent a single clan, what clan do you represent?</td>"
. " <td>"
. " <input type=text size=\"30\" name=\"Clan's Name\">"
. " </td>"
. "</tr>"
. "<tr>"
. "<td>During what time period is the Captain (Player A) generally online so that we may contact you for the final process?</td>"
. " <td>"
. " <textarea cols=\"25\" rows=\"4\" name=\"OnlineTime\"></textarea>"
. " </td>"
. "</tr>"
. ""
. ""
. "<td></td>"
. "<td colspan=\"2\"><input type=\"submit\"><input type=\"reset\"></td>"
. "</tr>"
. "</table>"
. "</form>"
. "</center>"
. "</html>";
}
// ADDED
switch($op){
// if no &op=xxxx is in url, this is where it defaults
default:
start();
break;
}
// This will execute modules.php?name=Forms&op=spt
case"spt":
spt();
break;
// this will execute modules.php?name=Forms&op=twohg
case"twohg":
twohg();
break;
// This will execute modules.php?name=Forms&op=threehg
case"threehg":
threehg();
break;
CloseTable();
include("footer.php");
?> |
What'd I screw up this time. |
| |
|
|
 |
gotcha
Site Admin


Joined: Oct 25, 2004
Posts: 756
|
Posted:
Fri Mar 24, 2006 8:40 pm |
|
this is the problem area
| php: |
// ADDED
switch($op){
// if no &op=xxxx is in url, this is where it defaults
default:
start();
break;
} <- this is in the wrong place
// This will execute modules.php?name=Forms&op=spt
case"spt":
spt();
break;
// this will execute modules.php?name=Forms&op=twohg
case"twohg":
twohg();
break;
// This will execute modules.php?name=Forms&op=threehg
case"threehg":
threehg();
break;
CloseTable();
include("footer.php");
|
fixed version
| php: |
// ADDED
switch($op){
// if no &op=xxxx is in url, this is where it defaults
default:
start();
break;
// This will execute modules.php?name=Forms&op=spt
case"spt":
spt();
break;
// this will execute modules.php?name=Forms&op=twohg
case"twohg":
twohg();
break;
// This will execute modules.php?name=Forms&op=threehg
case"threehg":
threehg();
break;
} // <- it should be here
// all blocks of "case" should go before the bracket
CloseTable();
include("footer.php");
|
|
Last edited by gotcha on Fri Apr 07, 2006 8:36 pm; edited 1 time in total |
|
|
 |
digatle

Joined: Feb 07, 2006
Posts: 13
|
Posted:
Fri Mar 24, 2006 8:46 pm |
|
Man did this put a huge smile on my face!! If you haven't heard it lately, thank you THANK YOU very much!! I see where I went wrong with the switch and everything.
Now I have to build some intelligence into the whole thing cause what I'm trying to accomplish is not just the forms but I want to make it 'dumb simple' for people to join an open league which shouldn't be too hard (yeah, this coming from a guy that took two days to figure this thing out).
But I have faith in me! THANK YOU AGAIN!!! |
| |
|
|
 |
|
|