I created a Facebook login page with Facebook PHP SDK, so, if I use this:
<?php echo '<a href=" ' . $loginUrl .' "> Log in with Facebook </a>'; } ?>
Works fine, but if I use this:
<form action="<?php echo $loginUrl; }?>">
<button type="submit" class="btn btn-block btn-social btn-facebook"><i class="fa fa-facebook"></i> | Connect with Facebook</button>
</form>
It doesn't work. In the address bar I see https://www.facebook.com/auth? instead this:
I try to put the last url into action=""
field, but the result is the same.
I don't find any answer and I don't know how I can resolve this problem.
To send data through a form
, you will need to use POST
:
<form action="<?php echo $loginUrl; }?>" method="POST">
<button type="submit" class="btn btn-block btn-social btn-facebook"><i class="fa fa-facebook"></i> | Connect with Facebook</button>
</form>