Featured post

c# - Usage of Server Side Controls in MVC Frame work -

i using asp.net 4.0 , mvc 2.0 web application. project requiremrnt have use server side control in application not possibl in noraml case. ideally want use adrotator control , datalist control. i saw few samples , references in codepleax mvc controllib howwver found less useful. can tell how utilize theese controls in asp.net application along mvc. note: please provide functionalities related adrotator , datalist controls not equivalent functionalities thanks in advace. mvc pages not use normal .net solution makes use of normal .net components impossible. a normal .net page use event driven solution call different methods service side mvc use actions , view completly different way handle things. also, mvc not use viewstate normal .net controlls require. found article discussing mixing of normal .net , mvc.

php - Facebook api search. -


i'm new studying facebook api search. use code, resault empty. can me? thanks.

<form action ="index.php" method ="post"> <input type="text" value="what is?" name="search" style="color:#999;text-align:center;" onfocus="if (value =='what is?'){value =''}" onblur="if (value ==''){value='what is?'}"/> <input type ="submit" value="ok" /> </form> <?php function callfb($url) {     $ch = curl_init();     curl_setopt_array($ch, array(         curlopt_url => $url,         curlopt_returntransfer => true     ));      $result = curl_exec($ch);     curl_close($ch);     return $result; }  $url = "https://graph.facebook.com/oauth/access_token?client_id=api_id&redirect_uri=my_url&client_secret=my_secret"; $access_token = callfb($url); $access_token = substr($access_token, strpos($access_token, "=")+1, strlen($access_token));  $url1 = "https://graph.facebook.com/search?access_token=".$access_token."&q=".urlencode($_post['search'])."&type=user"; $ret_json = callfb($url1); $users = json_decode($ret_json, true);  ?>  <img src="https://graph.facebook.com/<? echo $users[data][0][id]; ?>/picture?type=small"> 

your $url parameter set to:

"https://graph.facebook.com/oauth/access_token?ient_id=api_id&redirect_uri=my_url&client_secret=my_secret";

the values 'client_id', 'redirect_uri', , 'client_secret' still set placeholders. best way handle so:

<?  // params encoded in auth url $params = array(     'client_id' => $fb_app_id,     'redirect_uri' => $my_redirect_url,     'client_secret' => $fb_app_secret, );  // encode params in string $paramstring = "?"; foreach($params $key=>$value) {     $paramstring .= "&{$key]=" . urlencode($value); }  // auth url $url = "https://graph.facebook.com/oauth/access_token" . $paramstring; 

you should assign real desired values $fb_app_id, $my_redirect_url, , $fb_app_secret.

for $fb_app_id , $fb_app_secret, can them app's settings in facebook developer area app in question (at http://www.facebook.com/developer).

the value of $my_redirect_url has real url within 'web site' tab in edit app area: http://drktd.com/3zc4


Comments

Popular posts from this blog

c# - Usage of Server Side Controls in MVC Frame work -

cocoa - Nesting arrays into NSDictionary object (Objective-C) -

ios - Very simple iPhone App crashes on UILabel settext -