Ravens PHP Scripts: Forums
 

 

View next topic
View previous topic
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> Modules
Author Message
kguske
Site Admin



Joined: Jun 04, 2004
Posts: 6432

PostPosted: Sun Sep 25, 2005 11:21 am Reply with quote

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.

_________________
I search, therefore I exist...
nukeSEO - nukeFEED - nukePIE - nukeSPAM - nukeWYSIWYG
 
View user's profile Send private message
Donovan
Client



Joined: Oct 07, 2003
Posts: 735
Location: Ohio

PostPosted: Sun Sep 25, 2005 12:10 pm Reply with quote

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.
 
View user's profile Send private message Visit poster's website ICQ Number
kguske







PostPosted: Sun Sep 25, 2005 12:30 pm Reply with quote

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







PostPosted: Sun Sep 25, 2005 1:04 pm Reply with quote

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







PostPosted: Sun Sep 25, 2005 1:21 pm Reply with quote

It should if you uncomment everything except:
Code:
//      $result = $db->sql_query($sql);

You might also wish to insert
Code:
      die();

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







PostPosted: Sun Sep 25, 2005 1:31 pm Reply with quote

I'll do this later...

Thanks for your help Kevin.

Now to revisist my editmedal page and find out why that stopped working.

Smile
 
kguske







PostPosted: Sun Sep 25, 2005 1:45 pm Reply with quote

I noticed that admin/editmedalrecord.php changed on 9/13.
 
kguske







PostPosted: Sun Sep 25, 2005 1:48 pm Reply with quote

I changed the index file to load the editmedalrecord file properly from the admin directory.
 
Donovan







PostPosted: Tue Sep 27, 2005 8:18 am Reply with quote

Still didn't help.

After clicking Submit the page refreshes to display medals you added but nothing appears.
 
kguske







PostPosted: Tue Sep 27, 2005 10:27 am Reply with quote

So it's not saving the data correctly, or not displaying it correctly?
 
Donovan







PostPosted: Thu Sep 29, 2005 2:16 pm Reply with quote

It's not saving the data... ie.. not adding to the table.
 
Display posts from previous:       
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> Modules

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
You can attach files in this forum
You can download files in this forum


Powered by phpBB © 2001-2007 phpBB Group
All times are GMT - 6 Hours
 
Forums ©