Hi,

I am getting the above error. I am calling the function search_slideshow(). My home page is like this:

<?php include 'search_slideshow.php'; ?>
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>Untitled Document</title>
</head>
<body>
<?php
	$findme = 'jassim'; echo $findme;
	search_slideshare($findme)
?>
</body>
</html>

and my function is in search_slideshow.php like this:

function search_slideshare($query)
{
....... code here
}

can anyone help please

    Try changing the include to a require to see if it's correctly finding the file. You might also add some output to that file and check if that output is present.

      I tried require but getting the same error!

        Maybe try this:

        <?php
        ini_set('display_errors', true);
        error_reporting(E_ALL);
        require_once 'search_slideshow.php';
        ?><!doctype html>
        <html>
        <head>
        <meta charset="utf-8">
        <title>Untitled Document</title>
        </head>
        <body>
        <?php
        $findme = 'jassim'; echo $findme;
        search_slideshare($findme);
        ?>
        </body>
        </html>
        

        Then copy/paste the actual error message you get?

          I am getting the same error

          jassim
          Fatal error: Call to undefined function search_slideshare() in C:\xampp\htdocs\GraffitiWire\run.php on line 14

            I am now able to view the error. I enabled error_reporting in php.ini of xampp.

            The error shown now is:

            https://www.slideshare.net/api/2/search_slideshows?api_key=IrwIXI8r&ts=1413233411&hash=5f64048473e412b5ba56ebcfad39f2711a8ac04e&q=PHP&lang=en
            Warning: simplexml_load_file(): Unable to find the wrapper "https" - did you forget to enable it when you configured PHP? in C:\xampp\htdocs\GraffitiWire\search_slideshow.php on line 27

            Warning: simplexml_load_file(): I/O warning : failed to load external entity "https://www.slideshare.net/api/2/search_slideshows?api_key=IrwIXI8r&ts=1413233411&hash=5f64048473e412b5ba56ebcfad39f2711a8ac04e&q=PHP&lang=en" in C:\xampp\htdocs\GraffitiWire\search_slideshow.php on line 27

              So it would seem the real problem(s) is in the include file. Maybe that error is preventing it from ever executing the code that defines the function?

                The error message suggests that you don't have the OpenSSL extension installed/enabled; this is needed if you want to make an SSL connection.

                  Write a Reply...