I have created a file in my twentyten folder called

I have created a file in my twentyten folder called ipn.php:
add ipn.php file.

and notify_url I have set to: <input type="hidden" name="notify_url" value="<?php echo get_template_directory_uri(); ?>/ipn.php">

But after I have paid and the process on PayPal page is done and I am being redirected back to my thank you page (this part works ok), for some reason the ipn.php didn't insert transaction details in database. Why is that?

please give any solution for this problem.