How can we use ajax to implement the modification function? How can we use edit. php to read data and update. php to update data? How can we use ajax to implement the modification function? How can we use edit. php to read data and update. php to update data?
Reply content:
How can we use ajax to implement the modification function? How can we use edit. php to read data and update. php to update data?
If ajax is submitted to edit. php and edit. php, useheader("Location:update.php");
..
In fact, I think you want to use ajax to complete the process. After an edit file is submitted, edit receives the form and saves it successfully. The saved information is returned in json format, the browser receives and completes some dom operations.
Like
$.ajax({ type:'post', url:'edit.php', success:function(data){ $(result).html(JSON.parse(data)); }})
// Excerpt from the page I wrote at the beginning of last year.
Query ($ query) === TRUE) {if ($ pids = $ mysqli-> query ($ queryId) {while ($ id = $ pids-> fetch_object ()) {$ pid = $ id-> id; }}$ result = array ('id' => $ pid, 'type' => $ type, 'uid' => $ uid, 'content' => $ content, 'create _ time' => date ("H: I: s Y-m-d ", strtotime ($ create_time), 'editable' => true); echo json_encode ($ result);} else exit ();
Master station. Can I find details?
$('submit_btn').click(function(){ $.post('http://www.example.com/update.php',{data:data},function(callback){})})