Hi,

I am starting with Slideshare and trying to do a basic search using the below code but all I am getting is a blank page. why?

<?

function search($query)
{
    $url="http://www.slideshare.net/api/2/search_slideshows";

$api_key="xxxx";
$secret_key = "xxxxx";
// $time = time();
$hash = hash('sha1',$secret_key.$time);

$lang="en";

$req = $url ."?api_key=".$api_key
                   // ."&ts=".$time
                   ."&hash=".$hash
                   ."&q=".$query;
                   // ."&lang=".$lang;

echo $req;

$xml = simplexml_load_file($req)
or die();

var_dump ($xml);

}

$query = "PHP";

echo search($query);


?>

    You need to set display_errors (or log_errors) to On and error_reporting to E_ALL. Once you do that, you'll see that 1 notice and 2 warnings are being generated. (As for the warnings, visit the initially requested URL in your browser and note that the web service is trying to tell you something important.)

    EDIT: Also, when posting PHP code, please use the board's [noparse]

    ..

    [/noparse] bbcode tags as they make your code much easier to read and analyze.

      I added the following just before function search($query) but still nothing is shown except a blank page.

      ini_set('display_errors', 1);
      ini_set("track_errors", 1);
      ini_set("html_errors", 1);
      error_reporting(E_ALL);
      
        Write a Reply...