Are the broken links on your site? Because you can set a custom 404 page and just write your logic into that page without even having to rely on the user to submit anything.
Otherwise, yes, AJAX would work great for this. Prototype is a free and popular AJAX library. I like to bundle it with the Scriptaculous libraries to get some very cool and useful DHTML functionality.
AJAX let's you call a javascript function which can post data to another php page all within the current web page without leaving it. There are alternative tricks: such as posting to a form handler and then redirecting back to the report page (or they are one in the same.) You could use iframes as well.
However, reading your post again, it appears more likely that the pages are your broken pages. Thus you are probably already doing the custom 404 page. Why not just run the script and just tell them that the link has been reported (...$SERVER['REQUEST_URI']...) and then give them a link to the originating (..$SERVER['HTTP_REFERRER']...) page??