Take the 2-minute tour ×

I need to create some kind of JS onclick that will run a php mail script that emails a page with broken content.

Would it be best to run a normal javascript onclick that calls a php file which is hidden, grabs the referring url and emails it?

I would also like a message confirming the click, then disable it.

Is there anything like this available?

share|improve this question
I believe I figured this out, ill take an ajax contact form, strip it clean, add referring headers and should be good to go. –  user176213 Oct 3 '09 at 8:45
add comment

1 Answer

This will create onClick handler for your link, and action will be done in case user will accept confirm message.

var onClickHandler = function() {
       $.post("your_php_mail_script.php", {broken_url: document.location});

$("#your_link_id").bind("click", onClickHandler);

And that is all. In your script you'll get broken url as POST parameter ($_POST['broken_url']). This will be done asynchronous. I can't understand what you want to disable and after what action.

share|improve this answer
add comment

Your Answer


