need to run php script when form is submitted

Posted by Brad on Stack Overflow See other posts from Stack Overflow or by Brad
Published on 2010-06-03T15:03:05Z Indexed on 2010/06/03 15:04 UTC
Read the original article Hit count: 220

Filed under:
|
|
|
|

I have a form that needs to run a php script once the submit button is clicked, it needs to be ajax.

<form method="post" action="index.php" id="entryform" name="entryform">
<input type="submit" name="submit" value="Submit" onclick="JavaScript:xmlhttpPost('/web/ee_web/include/email-notification.php', 'entryform')" />
</form>

In this situation, using if(form posted) { get results and run script } is not an option, I need to run the script externally, that is why I need it to execute the email-notification.php at onclick

When I point my web browser to domain.com/include/email-notification.php - it runs perfectly.

Any help is appreciated.

© Stack Overflow or respective owner

Related posts about php

Related posts about JavaScript