Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //javascript function
- function submitComment(rowid, comment, event){
- if(event.keyCode == 13){
- $.post('../resource/ajax.php', {addcomment:comment, rowId:rowid});3
- alert('sent')
- }
- }
- //html
- <button id="deleteComment" name="deleteComment" value="<?php echo $comment['Id']; ?>" onclick="proceed()">X</button>
- //php ajax
- if(isset($_POST['addcomment'])){
- $comment = $_POST['addcomment'];
- $Dbid = $_POST['rowId'];
- $user = $_SESSION['session_user'];
- $sql = "INSERT INTO Dcomment (Id, Username, Email, Comments, UDate, Dbid) VALUES ('', '$user', '', '$comment', CURRENT_TIMESTAMP, '$Dbid')";
- $result = mysql_query($sql);
- }
Add Comment
Please, Sign In to add comment