<?php
header("content-type: application/json");
	 
	// Create a generic object.
	// Assign it the properties of id (optional - id of target HTML element, from URL)
	// and 'message' - the feedback message we want the user to see.
	if (isset($_GET['id'])) $rtnjsonobj->id = $_GET['id'];
	$rtnjsonobj->message = "You got an AJAX response via JSONP from another site!";
	 
	// Wrap and write a JSON-formatted object with a function call, using the supplied value of parm 'callback' in the URL:
//	echo $_GET['callback']. '('. json_encode($rtnjsonobj) . ')';   
	
$data = ($_GET['id']);
//$data = array ('a'=>1,'b'=>2,'c'=>3,'d'=>4,'e'=>5);
//$data=array(name => "Remy", "id" => "10", "blog" => "http://remysharp.com");

$data=array(user_name => "charlie", "id" => "11", "blog" => "http://whizbox.com");
echo $_GET['callback']. '('. json_encode($data) . ')';   

  
//  echo $_GET['jsonp_callback'] . '(' . $data . ');';
	 
	
   /*
      $myTweets = array(
   
          "text" => "Just handed in my last project ever ".
   
              "for my masters, all I have now is finals ".
   
              "next week. Goodbye, school. Hello, life.",
   
          "created_at" => "Thu May 07 21:36:12 +0000 2009"
   
      );
   
       
   
      $myTwitterUser = array("name" => "franklakatos");
  
      $myTweets['user'] = $myTwitterUser;
  
      $myJSONTweets = json_encode($myTweets);
  
       
  */
//    echo $myJSONTweets;
  
//$data='[{"name" : "Remy", "id" : "10", "blog" : "http://remysharp.com"}]';
 
  //echo $_GET['jsonp_callback'] . '(' . $data . ');';

    
//$id = array ('a'=>1,'b'=>2,'c'=>3,'d'=>4,'e'=>5);
  //$data = getDataAsJSON($_GET['id']);
//echo $_GET['jsonp_callback'] . '(' . $data . ');';

  /*
  
$arr = array ('a'=>1,'b'=>2,'c'=>3,'d'=>4,'e'=>5);
$data= json_encode($arr);

echo $_GET['jsonp_callback'] . '(' . $data . ');';
  */
  
//?([{"u":"http:\/\/nakedonstage.forumfree.it\/","d":"Naked on stage","t":["blog","babes","celebs"],"dt":"2010-11-15T22:15:28Z","n":"","a":"t.baggins"},{"u":"http:\/\/www.imdb.com\/name\/nm0001732\/","d":"Cybill Shepherd - IMDb","t":["imdb","celebs-cybill-shepherd","celebs"],"dt":"2010-11-15T14:17:01Z","n":"","a":"billalex"},{"u":"http:\/\/en.wikipedia.org\/wiki\/Cybill_Shepherd","d":"Cybill Shepherd - Wikipedia, the free encyclopedia","t":["celebs-cybill-shepherd","celebs","wikipedia"],"dt":"2010-11-15T14:13:34Z","n":"","a":"billalex"},{"u":"http:\/\/www.foolzfun.com\/the-best-of-christina-hendricks-cleavage-photos-t5784.html","d":"The Best of Christina Hendricks Cleavage Photos : Celebrity Gossips","t":["The","Best","Christina-Hendricks","Cleavage","Photos","celebs","celebrities","celebrity","hollywood","hot","sexy"],"dt":"2010-11-15T13:33:56Z","n":"","a":"alexleo975"},{"u":"http:\/\/www.foolzfun.com\/the-best-of-christina-hendricks-cleavage-photos-t5784.html","d":"The Best of Christina Hendricks Cleavage Photos : Celebrity Gossips","t":["The","Best","Christina-Hendricks","Cleavage","Photos","celebs","celebrities","celebrity","hollywood","hot","sexy"],"dt":"2010-11-15T13:24:08Z","n":"","a":"aneesfa243"},{"u":"http:\/\/www.foolzfun.com\/the-best-of-christina-hendricks-cleavage-photos-t5784.html","d":"The Best of Christina Hendricks Cleavage Photos : Celebrity Gossips","t":["The","Best","Christina-Hendricks","Cleavage","Photos","celebs","celebrities","celebrity","hollywood","hot","sexy"],"dt":"2010-11-15T13:23:56Z","n":"","a":"ondrejdyrka"},{"u":"http:\/\/entertainment.msn.com\/photos\/gallery.aspx?gallery=23996&photo=7519cc7b-48a0-4691-ba70-faeba5c2c016&affid=fb","d":"Sanrio's 50th Anniversary - Small Gift LA - Movies","t":["hellokitty","sanrio","cute","kawaii","photos","gallery","smallgift","la","losangeles","barkerhanger","santamonica","event","party","vip","celebs","celebrities"],"dt":"2010-11-14T23:51:38Z","n":"","a":"mariafleischman"},{"u":"http:\/\/www.mademan.com\/chickipedia\/","d":"Chickipedia - The Wiki of Hot Women","t":["women","fun","news","photo","babes","sexy","celebs","celebrity","chicks","chickipedia","girls","mademan","man"],"dt":"2010-11-14T22:59:24Z","n":"","a":"egy2002300113"},{"u":"http:\/\/www.fanpix.net\/","d":"FanPix.Net - Entertainment Pictures for Fans - Fan Pix, Fan Pics","t":["fan","pix","net","fans","pictures","pics","photos","photo","celebs","celebrity","images","gallery","celebrities"],"dt":"2010-11-14T22:28:22Z","n":"","a":"egy2002300113"},{"u":"http:\/\/ashleygreene.net\/","d":"AshleyGreene.net","t":["Celebs"],"dt":"2010-11-14T17:04:34Z","n":"","a":"arechmius"},{"u":"http:\/\/www.fakeclub.com\/list\/","d":"The List","t":["celebs","fake","fakes"],"dt":"2010-11-14T11:18:47Z","n":"","a":"TOENEE60"},{"u":"http:\/\/www.weblo.com\/","d":"Weblo Virtual Domains, Property, Celebrity and Auction","t":["virtual","moneymaker","celebs"],"dt":"2010-11-14T10:51:32Z","n":"","a":"pauluche"},{"u":"http:\/\/fire-your-agent.tumblr.com\/","d":"THE INTERNET NEVER FORGETS","t":["blog","photography","celebs","lulz"],"dt":"2010-11-13T08:27:55Z","n":"This is an appreciation blog exclusively for embarrassing modeling pictures of actors from those misguided years of their youth.","a":"adhira"},{"u":"http:\/\/epaper.timesofindia.com\/Default\/Scripting\/ArticleWin.asp?From=Archive&Source=Page&Skin=TOINEW&BaseHref=TOIM\/2010\/11\/13&PageLabel=50&ForceGif=true&EntityId=Ar05001&ViewMode=HTML&GZ=T","d":"Article Window","t":["physique","sylvesterstallone","personaltrainer","khali","focus","celebs","toi"],"dt":"2010-11-13T02:25:13Z","n":"","a":"hyper.real"},{"u":"http:\/\/top10celebs.net\/","d":"Celebrity Photo Galleries","t":["Celebs","pics,","sexy","celebs,","celebrities"],"dt":"2010-11-12T18:24:02Z","n":"","a":"fpaul90"}])

      #{"text":"Just handed in my last project ever for my masters, all I have now is finals next week. Goodbye, school. Hello, life.",
  
      #"created_at":"Thu May 07 21:36:12 +0000 2009",
  
      #"user":"{"name":"franklakatos"}"
  
      #}
 /* $data = getDataAsJSON($_GET['id']);
echo $_GET['jsonp_callback'] . '(' . $data . ');';
// prints: jsonp123({"name" : "Remy", "id" : "10", "blog" : "http://remysharp.com"});

*/

      ?>

