PHP & MySQL: Novice to Ninja book - markdown problem

Hello,

I’ve been going through this book because I’m fairly new to PHP. I’ve come to the section on p261 which indicates to download markdown.php, add it to the project and then add in the new code into helpers include file. I have done this but when I run it I get this error:

Fatal error: Call to undefined function Markdown() in C:\xampp\htdocs\includes\helpers.inc.php on line 17

I then downloaded the whole Michelf folder as suggested on the website and updated the path to account for this but I still have the same error. The code is:

function markdown2html($text)
{
$text = html($text);
include_once $_SERVER[‘DOCUMENT_ROOT’] . ‘/includes/Michelf/Markdown.php’;
return Markdown($text);
}

Can anyone let me know where I am going wrong?

Thanks
Sarah

did you include markdown.php ?

Hi,

Yes I included the whole folder as I mentioned above. It has the markdown.php in it.

Thanks
Sarah

Call to undefined function would inidicate that markdown.php does not actually contain a function named Markdown. What is the contents of that file?

I’m just a PHP n00b myself, but could it be a matter of referring to Markdown.php vs. markdown.php (case sensitivity)?

Yes, that could be the reason

Is the test enviroment set to send out E_ALL errors? If so, you’d have seen a E_WARNING level error on the include line.

I’ve used the example which is:
function markdownout($text)
{
//echo markdown2html($text);
include_once ‘…includes/markdown.php’;
return Markdown($text);
}

in the markdown.php the function starts: class Markdown {…

I’ve taken it out of the folder from the Michelf example to see that is the problem, but now I get no errors just nothing else on the page.