About Hitesh Chopra

  • Website: or email
  • Biography:

Posts by Hitesh Chopra:

 
0

Facebook Connect in Php

on Dec 30, 2010 in PHP

Facebook Connect in PHP,Just Follow these Steps :-

Upload all the files of zip folder on server.(Attached with this post)

Step 1 :  Just open the file where you have to use facebook connect.(e.g abc.php)

Step 2:  Just include this javascript file in head :-

“<script src=”http://static.ak.connect.facebook.com/js/api_lib/v0.4/FeatureLoader.js.php” type=”text/javascript”></script>”.

Step 3:  Include the file “facebook.php”(Uploaded with this post).

Step 4: To put login button of facebook connect :-

<fb:login-button onlogin=’window.location=”http://www.xyz.com/abc.php”;’ size=”medium” background=”white”  ></fb:login-button>

Step 5: create the object :-

$facebook = new Facebook(‘Facebook API key’,'Facebook  App Secret Key’,true);

Step 6: To get the user id of facebook login person:-

“$fUserId = $facebook->get_loggedin_user();”

Step 7: To get the session key for the api ->

$fc = new FacebookRestClient(‘facebook Api keyApi secret key’,$facebook->api_client->session_key);

Step 8: To initiate facebook connect,put this facebook connect–>

<script type=”text/javascript”>

var fb_api_key = “Facebook API key”;

if (fb_api_key>”") FB.init(“Facebook API key”, “/xd_receiver.htm”);

</script>

Step 9: To get user data of the login person –>

if($fUserId) {

$fUserData = $fc->users_getInfo($fUserId, ‘last_name,first_name,sex,current_location’);

}

Step 10: To see the fetched data :

<?php if($fUserId)

{

?>

Firstname — <?php echo $fUserData[0]['first_name']; ?><br/>

Lastname– <?php echo $fUserData[0]['last_name'];?><br/>

Sex– <?php echo $fUserData[0]['sex'];?><br/>

City– <?php echo $fUserData[0]['current_location']['city']; ?><br/>

State–<?php echo $fUserData[0]['current_location']['state']; ?><br/>

Country– <?php echo $fUserData[0]['current_location']['country']; ?><br/>

Zip– <?php echo $fUserData[0]['current_location']['zip']; ?><br/>

<?php }  ?>

Step 11: To use the buttons(Login & Logout) if a person is login or not :

<?php if (!$fUserId) { ?>

<fb:login-button onlogin=’window.location=”http://www.xyz.com/abc.php”;’ size=”medium”  background=”white”  ></fb:login-button>

<?php }

else {

?>

<input type=”button” value=”Logout” onclick = ‘FB.Connect.logout(function() { document.location =  “http://www.xyz.com/abc.php”; }); return false;’/>

<?php } ?>

Download : Facebook Files

It is done!

Tags: , ,

 
0

WinRunner (Invoking Flight Reservation)

on Aug 31, 2010 in Testing

It is a sample application we are going to test in Winrunner. Steps:- 1.) Open Win Runner 2.) Press F2(Start Recording). 3.) Press F7 4.) Select Invoke Application. 5.) Click Args. 6.) Click browse. 7.) Open C://Program Files/Mercury Interactive/WinRunner/Samples/Flight/app/flight1a 8.) Click Open 9.) Click Paste 10.) Click Execute. 11.) Input Agent Name,Password as “mercury”(always to [...]

 
0

WinRunner

on Aug 16, 2010 in Testing

It is a functional regression testing tool developed by mercury interactive corporation. Invoke Application 1.)It is an initial concept to establish a logical link between application & testing tool. 2.)Identifies whether the application invokes easily or not. CALCULATOR -> Windows simple Application to invoke or invoke_application Invoking Calculator Steps:-> 1.) Open Winrunner. 2.) Select blank [...]

 
0

Automation Testing

on Aug 11, 2010 in Testing

Automation Testing:-  It is a modern technique followed based on software engineering ISO, IEEE standards. Why Automation Testing:-  Automated software testing is the best way to increase the effectiveness, efficiency and coverage of your software testing. How Automation Testing Works: Automation Software Testing Tool is able to playback pre-recorded and predefined actions, compare the results [...]

bottombar