Facebook friend Invite - how to not have it redirect

Posted on 2012-09-10
Last Modified: 2012-10-02
After setting up an app as 'Website with Facebook Login' - I am using the Facebook code below to allow a user to send invites for a web page. The function works, meaning it opens a new tab, and allows the user to select users and send a request to visit a webpage. The issue is that once the user selects friends to send an invite to, and clicks "Send Request"  the window/tab redirects to the canvas page url defined in the code below. Is there a way to have hte Invite feature open a new window or tab or a modal window, and just close after sending the requests versus redirecting to a page?

         $app_id = "xxxxxxx";

         $canvas_page = "somewebpage....";

         $message = "Would you like to join me in this great app?";

         $requests_url = ""
                . $app_id . "&redirect_uri=" . urlencode($canvas_page)
                . "&message=" . $message;

         if (empty($_REQUEST["request_ids"])) {
            echo("<script> top.location.href='" . $requests_url . "'</script>");
         } else {
            echo "Request Ids: ";
Question by:cbittner
    LVL 19

    Accepted Solution


    Author Closing Comment

    Great option, thanks

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Better Security Awareness With Threat Intelligence

    See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

    Envision that you are chipping away at another e-business site with a team of pundit developers and designers. Everything seems, by all accounts, to be going easily.
    These days socially coordinated efforts have turned into a critical requirement for enterprises.
    Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
    The viewer will learn how to dynamically set the form action using jQuery.

    737 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    22 Experts available now in Live!

    Get 1:1 Help Now