I need to redirect to a php page with informations by POST when a user click on an image.
Here's the way I do it for now :
function redirect(id) {
var url = 'newPage.php';
var form = $('<form action="' + url + '" method="post">' +
'<input type="text" name="prankId" value="' + id + '"/>' +
'</form>');
$('body').append(form);
form.submit();
}
With Javascript, I create a form with my input and I submit it. But when i reload the page (that I redirected to), it ask me to resubmit my form. Is there a way to do it where I wouldn't have to resubmit it?