Question

I'm trying to use a value from onsubmit() in php.

More specific: An HTML form is being submitted by the client. The onSubmit passes it to a couple of javascript functions. One of these functions is supposed to fetch a list of registered emails from the database to check if it is already used.

<?php
$email='?> frm.add_fd2.value <?php ';
// execute query
$num_rows = mysql_num_rows($result); ?>
var num_rows = <?php echo (is_int($num_rows)) ? $num_rows : 0; ?>;
if (num_rows > 0) {
    // JAVASCRIPT ERROR
}

No correct solution

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top