0

when i am clicking on button, page is refreshing and share popup displayed and immediately hiding

any body help me

<?php
        /* Command Center Settings: Fill these out before you use the tool. */
        $googleApiClientId = "xxx"; // Your API client ID from https://code.google.com/apis/console/ 
        $inputSize = "70"; //How wide do you want the form fields to be?
        $commandCenterUrl =  "http://$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]"; // The URL of your command center installation. You shouldn't need to mess with this.
    echo $commandCenterUrl;
        /* Form functionality: Don't worry about chaning unless you know PHP and want to tweak the code. */
        if(isset($_POST["dataContentUrl"])) {
            $dataContentUrl = $_POST["dataContentUrl"];
        }
        else {
            $dataContentUrl = "http://plus.google.com/pages/";
        }
        if(isset($_POST["dataContentDeepLinkId"])) {
            $dataContentDeepLinkId = $_POST["dataContentDeepLinkId"];
        }
        else {
            $dataContentDeepLinkId = "/pages";
        }
        if(isset($_POST["dataPrefillText"])) {
            $dataPrefillText = $_POST["dataPrefillText"];
        }
        else {
            $dataPrefillText = "test";
        }
        if(isset($_POST["dataCallToActionLabel"])) {
            $dataCallToActionLabel = $_POST["dataCallToActionLabel"];
        }
        else {
            $dataCallToActionLabel = "CREATE";
        }
        if(isset($_POST["dataCallToActionURL"])) {
            $dataCallToActionURL = $_POST["dataCallToActionURL"];
        }
        else {
            $dataCallToActionURL = "http://plus.google.com/pages/create";
        }
        if(isset($_POST["dataCallToActionDeepLinkId"])) {
            $dataCallToActionDeepLinkId = $_POST["dataCallToActionDeepLinkId"];
        }
        else {
            $dataCallToActionDeepLinkId = "/pages/create";
        }
        if(isset($_POST["buttonText"])) {
            $buttonText = $_POST["buttonText"];
        }
        else {
            $buttonText = "Share Your Interactive Post!";
        }
    ?>
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:fb="http://www.facebook.com/2008/fbml" prefix="og: http://ogp.me/ns#" > 
<head>
    <!--Basic Meta Data Starts Here-->
    <meta name="description" content="Use this command center to generate your own Google+ Interactive Posts on the fly. No complex implementation necessary." />
    <meta name="robots" content="noindex,follow" />
    <!--Basic Meta Data Ends Here-->
    <!--Embedded CSS Stylesheet-->   
    <style>
        body {
            margin:40px;
            font-family: 'Arial', sans-serif
        }
        article {
            width: 600px;
            padding: 10px;
            border: 1px solid black;
            border-radius: 6px;
            box-shadow: 5px 8px 6px #888;
        }
        footer {
            text-align: center;
            font-size: 10px;
            margin-top: 25px;
        }
        h1 {
            font-size: 30px;
            margin: 0px;
        }
        h2 {
            font-size: 20px;
            margin: 0px;
        }
        sup {
            font-size: 10px;
        }

        #myBtn.g-interactivepost {
            padding: 5px;
            background: #fff;
            cursor: pointer;
            line-height: 20px;
            border: 1px solid #e6e6e6;
            border-radius: 4px;
        }
        #myBtn.g-interactivepost .icon {
            width: 20px;
            height: 20px;
            display: inline-block;
            background: url('./images/btn_icons_sprite.png') transparent 0 -40px no-repeat;
        }
        #myBtn.g-interactivepost:hover {
            background-color: #cc3732;
            color: #fff;
            border: #dd4b39;
        }
    #myBtn.g-interactivepost:hover .icon {
            background: url('./images/btn_icons_sprite.png') transparent 0 0px no-repeat;
        }
</style>
    <!--END Embedded CSS Stylesheet-->   
    <script>
        function check() {

            if(document.getElementById("embedCode").checked==true){
                document.getElementById("hiddenCode").style.display = "block";
                }

            else if(document.getElementById("embedCode").checked==false){
                document.getElementById("hiddenCode").style.display = "none";
                }
            }
    </script>


</head>
<body>
    <article>
        <!-- The Form -->
        <form id="commandCenterForm" action="<?php echo $commandCenterUrl; ?>" method="POST">
            <fieldset>
                <p><a title="The URL of the primary content that your post will link to." >Content URL</a></p>
                <p> <input type="text" name="dataContentUrl" size="<?php echo $inputSize; ?>" value="<?php echo $dataContentUrl; ?>"</p>
                <!-- <p><a title="(Optional) The ID of the deep mobile app link that the main feature should direct to." >Content Deep Link ID</a></p>
                <p> <input type="text" name="dataContentDeepLinkId" size="<?php echo $inputSize; ?>" value="<?php echo $dataContentDeepLinkId; ?>"</p> -->
                <p><a title="The prefilled out text that will be included in the post." >Prefill Text</a></p>
                <p> <input type="text" name="dataPrefillText" size="<?php echo $inputSize; ?>" value="<?php echo $dataPrefillText; ?>"</p>
                <p><a title="The CTA label, chosen from Google list of possible options." >Call to Action Label</a> </p>
                <p> <input type="text" name="dataCallToActionLabel" size="<?php echo $inputSize; ?>" value="<?php echo $dataCallToActionLabel; ?>"</p>
                <p><a title="The URL that the CTA button will point to." >Call to Action URL</a></p>
                <p> <input type="text" name="dataCallToActionURL" size="<?php echo $inputSize; ?>" value="<?php echo $dataCallToActionURL; ?>"</p>
                <!-- <p><a title="(Optional) The ID of the deep link into a mobile app." >Call to Action Deep Link ID</a></p>
                <p> <input type="text" name="dataCallToActionDeepLinkId" size="<?php echo $inputSize; ?>" value="<?php echo $dataCallToActionDeepLinkId; ?>"</p> -->
                <p><a title="The text that you want used on the button." >Button Text</a></p>
                <p> <input type="text" name="buttonText" size="<?php echo $inputSize; ?>" value="<?php echo $buttonText; ?>"</p>
                <p><input type="submit" value="Generate New Interative Post"></p>
            </fieldset>
        </form>

        <!-- Place the tag where you want the button to render -->
        <button id="myBtn" 
            class="g-interactivepost"
            data-contenturl="<?php echo $dataContentUrl; ?>"
            data-clientid="<?php echo $googleApiClientId; ?>.apps.googleusercontent.com"
            data-cookiepolicy="single_host_origin"
            data-prefilltext="<?php echo $dataPrefillText; ?>"
            data-calltoactionlabel="<?php echo $dataCallToActionLabel; ?>"
            data-calltoactionurl="<?php echo $dataCallToActionURL; ?>"
            data-calltoactiondeeplinkid="<?php echo $dataCallToActionDeepLinkId; ?>">
        <?php echo $buttonText; ?>
        </button>


    </article>

        <!-- Script for Google+ Interactive Posts -->
        <script type="text/javascript">
            (function() {
                var po = document.createElement('script'); po.type = 'text/javascript';
                po.async = true;
                po.src = 'https://apis.google.com/js/client:plusone.js';
                var s = document.getElementsByTagName('script')[0];             
                s.parentNode.insertBefore(po, s);
                })();
        </script>
</body>
</html>
1
Contributor
1
Reply
9
Views
2 Years
Discussion Span
Last Post by ramsiva
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.