Jump to content

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

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.