douci4026 2013-09-30 05:28
浏览 44
已采纳

通过javascript弹出传递来自php的网址

url.php

<?php
include "../googlelogin/src/Google_Client.php";
include "../googlelogin/src/contrib/Google_Oauth2Service.php";
include "../fblogin/src/facebook.php";
//FOR FACEBOOK LOGIN//
    $fbconfig['appid' ]     = "329433909112888";
    $fbconfig['secret']     = "ca2bdc9990b0b2ad0763abcka79dce60c91f";
    $fbconfig['baseurl']    = "http://localhost/sbs/fblogin/index.php?rd=hm";
    $facebook = new Facebook(array(
        'appId'  => $fbconfig['appid'],
        'secret' => $fbconfig['secret'],
        'baseurl'=>$fbconfig['baseurl'], 
        'cookie' => true,
    ));
    $loginUrl   = $facebook->getLoginUrl(
        array('redirect_uri'=>$fbconfig['baseurl'], 
        'scope'  =>            'email,offline_access,publish_stream,user_birthday,user_location,user_work_history,user_about_me,   user_hometown,user_photos ,user_work_history',
    )
    );
//FOR GOOGLE LOGIN//
    $client = new Google_Client();
    $client->setApplicationName("Google UserInfo PHP Starter Application");
    $client->setApprovalPrompt('auto');
    $client->setClientId('777637661406-cp7kekelp1l5i0se9f576sqf36a0q4lc.apps.googleusercontent.com');
    $client->setClientSecret('uztEmqG1CFt06752lqtRZjZ-');   
    $client->setState('hm');
    $client->setRedirectUri('http://localhost/sbs/googlelogin/index.php');
    $client->setDeveloperKey('AIzaSyD3HiHElDciE6Pb5UfZtDdNWe_kiKNk6rg');
    $oauth2 = new Google_Oauth2Service($client);
    $authUrl = $client->createAuthUrl();

    ?>

I want to pass the FACEBOOK , TWITTER AND GOOGLE url in via java script in the pop up . I know the PHP part but I don't know the JS part

pop.js

function sin(){
    var lbox = new LadduBox();
    lbox.init({"width":495, "height":242, "HTML":'<div style="width:495px; height:242px; background-color:#ffffff; border:2px solid orange;"><table cellspacing="0" cellpadding="0" border="0" align="center" width="485" height="152" style="font-family:arial; font-size:20px; font-weight:bold;"><tr><td align="right" colspan="3"><img src="images/untitled-1.png" style="margin:10px; cursor:pointer;" id="btnClose"/></td></tr><tr><td height="30" colspan="3"> <div style="font-family:arial; font-size:20px; color:#ff6c00; padding-left:200px;">SIGN IN</div></td></tr><tr><td><div style="margin:10px; font-size:14px;">EMAIL<br><input type="text"/></div><br><div style="margin-left:10px; margin-top:-10px; font-size:14px;">PASSWORD<br><input type="text"/></div></td><td><img src="images/orbar.png" /></td><td align="center"><img src="images/redfb.png" style="margin-bottom:7px;"/><br><img src="images/redgoogle.png" style="margin-bottom:7px;"/><br><img src="images/redtwitter.png" /></td></tr></div>', 'btnCloseId':'#btnClose'});
    lbox.fire();
}

When the user click on the sign-in button , this pop-up will show . I want FACEBOOK , TWITTER AND GOOGLE URL in the pop-up but i don't know how to pass it in javascript .

  • 写回答

2条回答 默认 最新

  • duanou3868 2013-09-30 05:32
    关注
    "When the user click on the sign-in button, this pop-up will show":
    

    Now, the popup code will be inside a PHP file. Include url.php in this file at top, then you can access those $authUrl or $loginUrl anywhere in this file.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

悬赏问题

  • ¥50 安装pyaudiokits失败
  • ¥15 计组这些题应该咋做呀
  • ¥60 更换迈创SOL6M4AE卡的时候,驱动要重新装才能使用,怎么解决?
  • ¥15 让node服务器有自动加载文件的功能
  • ¥15 jmeter脚本回放有的是对的有的是错的
  • ¥15 r语言蛋白组学相关问题
  • ¥15 Python时间序列如何拟合疏系数模型
  • ¥15 求学软件的前人们指明方向🥺
  • ¥50 如何增强飞上天的树莓派的热点信号强度,以使得笔记本可以在地面实现远程桌面连接
  • ¥20 双层网络上信息-疾病传播