Author |
Message |
Raven
Site Admin/Owner

Joined: Aug 27, 2002
Posts: 17088
|
Posted:
Sun Dec 17, 2006 12:21 pm |
|
No. When you call the page up that produces the image up above. Do a Page Source and save the source (rendered HTML), zip it up and email it to me. |
|
|
|
 |
Donovan
Client

Joined: Oct 07, 2003
Posts: 735
Location: Ohio
|
Posted:
Sun Dec 17, 2006 12:28 pm |
|
Sent to raven AT ravenphpscripts DOT com |
|
|
 |
 |
Raven

|
Posted:
Sun Dec 17, 2006 2:01 pm |
|
I sent you an email back. |
|
|
|
 |
gregexp
The Mouse Is Extension Of Arm

Joined: Feb 21, 2006
Posts: 1497
Location: In front of a screen....HELP! lol
|
Posted:
Sun Dec 17, 2006 7:37 pm |
|
I Thought I would drop in, and ask something simple.
From your form, you have 3 things named
$ateam_id = $_POST['team_id'];
$dteam_id = $_POST['dteam_id'];
$tid = $_POST['tid'];
$action = 'Attack';
Notice that your form has ateam_id, dteam_id, and tid. But your form uses team_id, I think you need to change that code to $_POST['ateam_id']. I dont know what is being returned, quick way to check , print_r($_POST);
You will need to see whats getting passed in order to tell whats wrong, $_POST is an array and print_r will help to see that array in its entirety. |
_________________ For those who stand shall NEVER fall and those who fall shall RISE once more!! |
|
 |
 |
Donovan

|
Posted:
Sun Dec 17, 2006 9:35 pm |
|
team_id gets passed in from the previous page. That is why I am not using $_POST['ateam_id']
I try to write the value of team_id into $ateam_id
The dteam_id is generated on the Attack page so that is why I am trying to use $_POST with that value.
I'll try the print_r with $_POST and see what happnens. |
|
|
|
 |
Donovan

|
Posted:
Sun Dec 17, 2006 9:56 pm |
|
|
|
 |
gregexp

|
Posted:
Mon Dec 18, 2006 6:39 pm |
|
Basically that means that your form is not processing the way you expect it.
Reason: no submit, nothing in the $_POST array.
Solution, I would either put a submit button in the form, this may not be the best and easiest solution for you, so I would make those click links you have, carry the data in order to actually put it in the $_GET array. I dont think sentinel will like that much, so a Call to the requested url might be necessary, then strip out the things like the domain and the file, and split whats left with an explode of the & symbol. Then I would do an process of each object returned. I know the admin section does something similar, I never really looked into it. I would sudjest a new aproach similar to the one I proposed. I hope this is what you need.
I would love to find out how to make a form auto act on close, Shy of Javascript function, I cant think of a way to do that. |
|
|
|
 |
Donovan

|
Posted:
Thu Dec 28, 2006 12:12 pm |
|
Well you lost me on some of that. I have been looking at this for awhile now as has Raven himself. We exchanged quite a few emails but so far cannot figure it out.
I tried to split out the ConfirmAttack to a separate page but I only got the same result.
Would really like to get this working. I am way overdue. |
|
|
|
 |
gregexp

|
Posted:
Thu Dec 28, 2006 6:42 pm |
|
If Raven and yourself wouldnt mind, please send me the code, only the base code, forget the nuke part if thats possible. I would like to see how the code is being propogated. Anything submitted should process, but you cant have a form $_POST to another page, then without another form, also post to a second, basically, you cant go from index.html form processed to form.php then redirected to a thankyou.php
By the time It gets to thankyou.php, the $_POST variable will be empty.
If you could send me the base code, Id like to look at it. |
|
|
|
 |
Donovan

|
Posted:
Thu Dec 28, 2006 7:30 pm |
|
|
|
 |
Donovan

|
Posted:
Tue Jan 02, 2007 10:09 am |
|
I'm gonna try and pass this with a function and insert that way. |
|
|
|
 |
gregexp

|
Posted:
Tue Jan 02, 2007 7:17 pm |
|
Donovan, Truly my apologies, I wanted to help on this but to be honest things have gotten so backed up here, I dont think I have time to. Somethings have really hurt my time to work on things. Im sorry but these things came sudenly and had no chance to really prepare. I hope you get this resolved. |
|
|
|
 |
Donovan

|
Posted:
Tue Jan 02, 2007 7:21 pm |
|
Ok.
I created a function and passed all my values in the ConfirmAttack variable.
My case statement in my index.php reads
Code:case "ConfirmAttack":
confirmattack($team_id, $ateam_id, $dteam_id, $tid, $ateam_name, $dteam_name, $territory);
break;
|
and my function written below is
Code:function confirmattack($team_id, $ateam_id, $dteam_id, $tid, $ateam_name, $dteam_name, $territory, $selectenemy) {
global $module_name, $db, $prefix;
include_once("modules/$module_name/common.php");
$action = "Attack";
$verify = checkstatus($team_id);
if ($verify) {exit();}
$enemy = checkmove($tid, $team_id);
if (!$enemy) {
OpenTable();
echo"<center><h3><b>" . _ATTACKTEAMS. "</b></h3></center><br><br>"
."<center><b><font color=RED size=4> There are no enemy forces positioned on your territory! </font></b></center><br><br>"
."<center><b> Your team is not in a position to attack at this time! </b></center><br><br>"
."<center><b> Move your team to a territory and engage enemy forces! </b></center><br><br>"
."<br>";
CloseTable();
include('footer.php');
}else{
$result = $db->sql_query ("INSERT INTO " . $prefix . "_eto_tracking (log_id, ateam_id, dteam_id, tid, move_dt, action)".
"VALUES (NULL,'$ateam_id','$dteam_id','$tid', CURRENT_TIMESTAMP(),'$action')");
echo "<P><font color=RED size=4><center>Attack Orders Have Been Sent!</center></font></p>";
include_once("footer.php");
}
|
The end of my form now looks like this.
Code:while ( $row = $db->sql_fetchrow($sql) ) {
$dteam_id = $row['team_id'];
$dteam_name = $row['name'];
$tid = $row['tid'];
$territory = $row['t_name'];
echo "<tr>"
."<td align=\"center\" bgcolor=\"#666666\"><font color=\"#000000\">$dteam_id</font>"
. "<input type=\"hidden\" name=\"ateam_id\" value=\"$ateam_id\">"
. "<input type=\"hidden\" name=\"dteam_id\" value=\"$dteam_id\">"
. "<input type=\"hidden\" name=\"tid\" value=\"$tid\">"
. "<td align=\"center\" bgcolor=\"#666666\"><font color=\"#000000\">$dteam_name</font></td>"
. "<td align=\"center\" bgcolor=\"#666666\"><font color=\"#000000\">$territory</font></td>"
. "<td align=\"center\" bgcolor=\"#666666\"><input type=\"radio\" name=\"selectenemy\" value=\"\"></td>"
. "</tr><br>";
}
echo"<tr><td><input type=\"submit\" value=\"Attack\"></td></tr>";
echo"<input name=\"op\" type=\"hidden\" value=\"ConfirmAttack\"\">";
|
How do I ensure the value of the radio button to be able to insert the correct dteam_id?
I have a dteam_id being written but it is the last in the query. I need it to write the correct one I selected with the radio button. |
|
|
|
 |
Donovan

|
Posted:
Tue Jan 02, 2007 9:12 pm |
|
Got it working.
Code:while ( $row = $db->sql_fetchrow($sql) ) {
$dteam_id = $row['team_id'];
$dteam_name = $row['name'];
$tid = $row['tid'];
$territory = $row['t_name'];
echo "<tr>"
."<td align=\"center\" bgcolor=\"#666666\"><font color=\"#000000\">$dteam_id</font>"
."<input type=\"hidden\" name=\"ateam_id\" value=\"$ateam_id\">"
."<input type=\"hidden\" name=\"tid\" value=\"$tid\">"
."<td align=\"center\" bgcolor=\"#666666\"><font color=\"#000000\">$dteam_name</font></td>"
."<td align=\"center\" bgcolor=\"#666666\"><font color=\"#000000\">$territory</font></td>"
."<td align=\"center\" bgcolor=\"#666666\"><input type=\"radio\" name=\"dteam_id\" value=\"$dteam_id\"></td>"
. "</tr><br>";
}
echo"<tr><td><input type=\"submit\" value=\"Attack\"></td></tr>";
echo"<input name=\"op\" type=\"hidden\" value=\"ConfirmAttack\"\">";
echo"</table>";
echo"</form>";
|
|
|
|
|
 |
|