Search This Blog

Thursday, March 26, 2009

PHP file from an onsubmit

You cannot call a PHP file from an onsubmit, only javascript files.
What you can do:
echo "
";
echo "

When you submt, it will load the page again, do a check at the top of the page:
if (isset($_POST["sendchekc"] && $_POST["sendcheck"] == "ok")
{
$delme = mysql_query("update preorder set deleted='1' where preord_prodno='" . $_POST["preprodno"] . "'",$con) or die('Sorry Dear! product could not be deleted : ' . mysql_error());
}

If you don't want the page to reload, look for an AJAX method ...

No comments:

Post a Comment

content-wide advt