简体   繁体   中英

How do i go to another php page with Facebook login

This is my facebook login button in my index.php

<div class="fb-login-button" data-max-rows="1" data-size="medium" data-show-faces="false" data-auto-logout-link="true"></div>

what do i do i need to add so that when i click the login button it goes to another php file ?

If you're using jQuery you can use .click() to do something when it gets clicked and then do a redirect with window.location.href .

$(".fb-login-button").click(function() {
    window.location.href = "link_to_new_page";
});

Throw this in <script> -tag in <head></head> or before </body> .

edit: While saying that, wouldn't just a link element <a href='link'><div here></a> work?

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM