Facebook登录按钮PHP与HTML。 网址不起作用

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:

https://www.facebook.com/v2.4/dialog/oauthclient_id=1749262215245660&state=f64bde5b467152e8d65576729051cd8e&response_type=code&sdk=php-sdk-.1.2&redirect_uri=http%3A%2F%2FmyURL%2Fsomedir%2F&scope=email

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>