imperialized Posted July 27, 2009 Share Posted July 27, 2009 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>"; Quote Link to comment https://forums.phpfreaks.com/topic/167574-replacing-using-ajax-dont-move/ Share on other sites More sharing options...
vineld Posted July 27, 2009 Share Posted July 27, 2009 If you simply print html that way it will not be appended to your table, unless you mess up your html completely that is You need to produce and evaluate javascript instead. So it's not really a php issue. Quote Link to comment https://forums.phpfreaks.com/topic/167574-replacing-using-ajax-dont-move/#findComment-883701 Share on other sites More sharing options...
patrickmvi Posted July 27, 2009 Share Posted July 27, 2009 What does your ajax JS function do witht the returned output? I think that's more where your problem lies. Quote Link to comment https://forums.phpfreaks.com/topic/167574-replacing-using-ajax-dont-move/#findComment-883876 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.