I probably have several things wrong with this PHP form but I am trying to get this to work. It is just one of several I will be using to admin my MILPACS module in PHPNuke that can be seen here.
http://www.3rd-infantry-division.net/modules.php?name=MILPACS&file=unitprofile&unit_id=2
This is my editunit page.
I am getting this error time after time:
Parse error: parse error, unexpected T_ECHO in /home/thirdadm/public_html/modules/MILPACS/editunit.php on line 79
<?php
//////////////////////////////////////////////////////////////////////
//===========================
// MILPACS
//
// This is the Military Personell and Classification System.
//
//
//
///////////////////////////////////////////////////////////////////////
if (!eregi("modules.php", $PHP_SELF)) {
die ("You can't access this file directly...");
}
$index = 0;
//finds the server's root directory
$self = dirname(__FILE__);
$nukemod = basename($self);
$rootdir = eregi_replace("/modules/$nukemod", "", $self);
$index=0;
require_once("mainfile.php");
global $module_name, $db;
$module_name = basename(dirname(__FILE__));
include("header.php");
OpenTable();
echo "<html>";
echo "<body>";
echo "<form name=\"editunit\">";
echo "<form action=\"$_SERVER ['PHP_SELF']\" method=\"POST\">";
echo "<div align=\"center\">";
echo "<H2>3rd ID Unit Page</H2>";
echo "<HR>";
echo "</div>";
echo "<br>";
$unit_count = max("SELECT unit_id FROM roster_units");
$counter = 0;
while ( $counter <= $unit_count) {
echo "<H3>Unit Information</H3>";
$sql = "SELECT * FROM roster_units ORDER BY unit_id";
$result = $db->sql_query($sql);
while ( $row = $db->sql_fetchrow($result) ) {
$unit = $row["unit_name"];
$nick = $row["unit_nick"];
$creed = $row["unit_creed"];
$motto = $row["unit_motto"];
$image = $row["unit_image"];
$goal1 = $row["unit_goal_one"];
$goal2 = $row["unit_goal_two"];
$goal3 = $row["unit_goal_three"];
$bio = $row["unit_bio"];
}
echo" <HR>"
. " <table align= center>"
. " <tr> "
. " <th align = right>Unit:</td><input type=\"text\" name=\"$unit\" size=\"30\"/>"
. " <tr> "
. " <th align = right>Unit Name:</td><input type=\"text\" name=\"$nick\" size=\"25\"/>"
. " <tr> "
. " <th align = right>Creed:</td><input type=\"text\" name=\"$creed\" size=\"25\"/>"
. " <tr> "
. " <th align = right>Motto:</td><input type=\"text\" name=\"$motto\" size=\"25\"/>"
. " <tr> "
. " <th align = right>Unit Image:</td><input type=\"text\" name=\"$image\" size=\"25\"/>"
. " <tr> "
. " <th align = right>Goal One:</td><input type=\"text\" name=\"$goal1\" size=\"25\"/>"
. " <tr> "
. " <th align = right>Goal Two</td><input type=\"text\" name=\"$goal2\" size=\"20\"/>"
. " <tr> "
. " <th align = right>Goal Three:</td><input type=\"text\" name=\"$goal3\" size=\"25\"/>"
. " <tr>"
. " <th align = right>Unit Bio:</td><input type=\"text\" name=\"$bio\" size=\"25\"/>"
. " <tr>"
. " <td colspan=2 align=center>"
. " <input type=submit value=\"Update Unit\">"
. " </table> "
. "</form>";
}
echo "</body>";
echo "</html>";
CloseTable();
include("footer.php");
?>