Elnof Posted June 28, 2007 Share Posted June 28, 2007 Is there such a thing as events in PHP? I want to use the FILTER_VALIDATE_EMAIL when the user clicks 'submit', but the only way I can think to do that is: ...<input type="submit" onClick="<?PHP if (!filter_input(INPUT_GET, "email", FILTER_VALIDATE_EMAIL)) { echo "Enter a valid E-mail"; } else { echo "Thank You!"; } }?>" />... Would that work? Link to comment Share on other sites More sharing options...
justsomeguy Posted June 28, 2007 Share Posted June 28, 2007 No, you cannot run PHP code client-side, only on the server. If you want to do that, you need to use AJAX to send the email address to a PHP script which can check it and send a response back, or just submit the form and check the email on the next page like usual. Link to comment Share on other sites More sharing options...
Elnof Posted June 28, 2007 Author Share Posted June 28, 2007 Ok, I'll do that. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.