Hello,
I want to help with my code.i am just not able to find out that is it a php problem or java scripts.
viewf.php
HTML Code:
<span>
<a href="javascript: edit(<?=$row['id'];?>,<?=$row['friends'];?>);" title="edit">Edit</a></span>|
can i send something value like this in java script. i want to update my friends name so i need both id and friends value
edit.php
PHP Code:
$id = $_REQUEST['id'];
$friends =$_REQUEST['friends'];
$query = "UPDATE friends set friends='".$friends."' where id='$id'";
and my ajax.js
Code JavaScript:
function edit(id,friends){
document.getElementById(id,friends).innerHTML = "<em>editing...</em>";
alert("hello");
http.open('GET', 'edit.php?id='+id+'&friends='+friends);
http.onreadystatechange = insertReply1;
http.send(null);
}
can anyone help me with my code? now the status is record is getting empty as soon as i fire the query. i dont want to delete record but want to update it. it seems friends value is not getting passed through my JS.
thanks in advance
Bookmarks