Author
Message
kguske Site Admin Joined: Jun 04, 2004 Posts: 6044
Posted:
Sun Sep 25, 2005 11:21 am
That might be because there is still a form field named "name". You changed the PHP variable to soldierName, but the form field name must also be different. Try it now.
Donovan Client Joined: Oct 07, 2003 Posts: 735 Location: Ohio
Posted:
Sun Sep 25, 2005 12:10 pm
All Right....Making progress.
I added a soldier to the roster but it doesn't add unit_id, weapon_id, rank_id
so it will not appear on the roster until I get this working.
I took this from the editsoldier.php page and tried to modify to add soldiers.
kguske Site Admin Joined: Jun 04, 2004 Posts: 6044
Posted:
Sun Sep 25, 2005 12:30 pm
Change these lines:
Code: $rank_id = intval($_POST[$rank_id]);
$unit_id = intval($_POST[$unit_id]);
$weapon_id = intval($_POST[$weapon_id]);
$bio = addslashes($_POST[$bio]);
to:
Code: $rank_id = intval($_POST['rank_id']);
$unit_id = intval($_POST['unit_id']);
$weapon_id = intval($_POST['weapon_id']);
$bio = addslashes($_POST['bio']);
Also, there is duplicate code for loading the units into the select.
Donovan Client Joined: Oct 07, 2003 Posts: 735 Location: Ohio
Posted:
Sun Sep 25, 2005 1:04 pm
Thanks for your help.
Do you know if this would work
Code:
//Insert the values into the correct database with the right fields
$result = $db->sql_query ("INSERT INTO " . $prefix . "_milpacs_members (uniqueid, name, uniform, rank_id, flag, location, status, p_mos, unit_id, reports, position, weapon_id, enlistment_dt, icq, bio)".
"VALUES ('NULL','$soldierName','$uniform', $rank_id, '$flag', '$location', '$status', '$p_mos', $unit_id, '$reports', '$position', $weapon_id, '$enlistment_dt', '$icq', '$bio')");
if (!$result) {
echo("<p>Error adding Soldier!" . mysql_error() . "</p>");
}
// else {
// $result = $db->sql_query($sql);
// echo "<META HTTP-EQUIV=\"refresh\" content=\"0;URL=modules.php?name=MILPACS&file=roster\">";
// }
}
I wanted to go to the roster after I submitted but it was going straight to the roster when I first went to the addsoldier.php page.
It's like it doesn't stop on addsoldier but goes straight through to roster.
I commented it out for now.
kguske Site Admin Joined: Jun 04, 2004 Posts: 6044
Posted:
Sun Sep 25, 2005 1:21 pm
It should if you uncomment everything except:
Code: // $result = $db->sql_query($sql);
You might also wish to insert
after the refresh echo statement to that it doesn't try to reload the screen in the fraction of a second between issuing the refresh and it taking place.
Donovan Client Joined: Oct 07, 2003 Posts: 735 Location: Ohio
Posted:
Sun Sep 25, 2005 1:31 pm
I'll do this later...
Thanks for your help Kevin.
Now to revisist my editmedal page and find out why that stopped working.
kguske Site Admin Joined: Jun 04, 2004 Posts: 6044
Posted:
Sun Sep 25, 2005 1:45 pm
I noticed that admin/editmedalrecord.php changed on 9/13.
kguske Site Admin Joined: Jun 04, 2004 Posts: 6044
Posted:
Sun Sep 25, 2005 1:48 pm
I changed the index file to load the editmedalrecord file properly from the admin directory.
Donovan Client Joined: Oct 07, 2003 Posts: 735 Location: Ohio
Posted:
Tue Sep 27, 2005 8:18 am
Still didn't help.
After clicking Submit the page refreshes to display medals you added but nothing appears.
kguske Site Admin Joined: Jun 04, 2004 Posts: 6044
Posted:
Tue Sep 27, 2005 10:27 am
So it's not saving the data correctly, or not displaying it correctly?
Donovan Client Joined: Oct 07, 2003 Posts: 735 Location: Ohio
Posted:
Thu Sep 29, 2005 2:16 pm
It's not saving the data... ie.. not adding to the table.
Goto page Previous 1 , 2
View next topic
View previous topic
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum