Right now I have this:
echo "<a href='misc/removeWallComment.php?id=" .
$displayWall['id'] . "&uID" . $displayWall['uID'] . "&BuID" .
$displayWall['BuID'] . "' title='ta bort inlägg'>
<span class='removeWallComment'></span> </a>";
Its an icon with a link that removes the comment when you click.
Now, it goes to misc/removeWallComment.php and echo out “comment removed”. But I would like to integrate it with my current site, so you don’t go to another page to delete the commehnt. With this I thought of using an ajax call to removeWallComment.php.
Now as you see on the link it requires three variables, id, uID and BuID, and I want to send it POST, not GET so the user can’t see the variables in address bar. On success it should just alert ok.
How can I do this?
Just so that this question will have an answer:
It doesn’t matter if you use
GETorPOST, if you’re using ajax you’re user will never see the threeids in the address bar. The threeids, however, must be gotten somehow, so in this case we are parsing thehrefvalue for them (the threeidmust be stored somewhere, preferably on the element itself for easy retrieval. If you want to hide theids for security reasons this isn’t the best way to do it).