using post from any button
$('.btn-logout').on('click', function() {
$('<form action="<?=$url_local?>member/logout" method="post"> <input name="token" value="<?= $obj_user ? $obj_user['token'] : '' ?>"/> </form>').appendTo('body').submit();
});
using post from any button
$('.btn-logout').on('click', function() {
$('<form action="<?=$url_local?>member/logout" method="post"> <input name="token" value="<?= $obj_user ? $obj_user['token'] : '' ?>"/> </form>').appendTo('body').submit();
});
html button send post request
<form method='POST' action='myFile.php'>
<input name='myInput'>
<button type='submit'>Submit</button>
<!--Sends input value to the page set as 'action' parameter.
For example a php file.-->
</form>
send get request with button to endpoint
form.addEventListener('submit', (event) => {
event.preventDefault(); //stop reload
let input = document.querySelector('input');
let method = 'GET';
let endpoint = `request url ${input.value}`;
xhr.open(method, endpoint);
xhr.send(); //if in the link what you looking for this send will be empty!!!
});
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us