Jump to content

Replacing using Ajax (don't move!)


imperialized

Recommended Posts

Ok, this isnt a problem with the ajax itself (so I put it this forum)

 

 

The ajax function is called properly and does what its supposed to. However, when it prints back, it prints above my table.

 

Code:

if(isset($_SESSION[poker_name]) && $is_admin == "1"){
							// THEY ARE LOGGED IN and an Admin		
								print "<table width=450 border=\"1\" cellspacing=\"0\" cellpadding=\"2\">
								<tr>
									<td>From</td>
									<td>To</td>
									<td>Amount</td>
									<td>Date</td>
									<td>A</td>
									<td>D</td>
								</tr>
								";

								$get_transfers = mysql_query("SELECT * FROM transfers WHERE approved = '0'");
								while($gt = mysql_fetch_array($get_transfers)){
									//While we have transfers loop through and get er done.
									$formatted = date("m.d.y", $gt[time]);  
									print "
									<tr>
									<span id=\"$gt[id]\">
									<td>$gt[from]</td>
									<td>$gt[to]</td>
									<td>$gt[amount]</td>
									<td>$formatted</td>
									<td align=\"center\"><input type=\"button\" onClick=\"ajax($gt[id], 'includes/transfers.php?id=$gt[id]&what=a')\" value=\"Approve\"></td>
									<td align=\"center\"><input type=\"button\" onClick=\"ajax($gt[id], 'includes/transfers.php?id=$gt[id]&what=d')\" value=\"Deny\"></td>
									</span>
									</tr>

									";
								}

								print "</table>";

 

Returned from ajax:

 

	print "<td colspan=5 align=\"center\"><font color=\"#11FF00\">Transfer Approved</font></td>"; 

Link to comment
https://forums.phpfreaks.com/topic/167574-replacing-using-ajax-dont-move/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.