Plazman65 Posted March 6, 2006 Share Posted March 6, 2006 Happy monday all,I have finally after lots and lots of reading and some help got to where I want to be,I have info on my site going fromselect member type ->registration->payment form->membership confirmation.one the membership confirmation page I have two hidden forms I would like to either be able to submit to two different tables with one submit button or Ideally have both forms submitted on page load?I hope this makes sense thanks for your help, Michelle Quote Link to comment https://forums.phpfreaks.com/topic/4245-submit-on-page-load/ Share on other sites More sharing options...
Plazman65 Posted March 7, 2006 Author Share Posted March 7, 2006 <?phpfunction GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "") { $theValue = (!get_magic_quotes_gpc()) ? addslashes($theValue) : $theValue; switch ($theType) { case "text": $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL"; break; case "long": case "int": $theValue = ($theValue != "") ? intval($theValue) : "NULL"; break; case "double": $theValue = ($theValue != "") ? "'" . doubleval($theValue) . "'" : "NULL"; break; case "date": $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL"; break; case "defined": $theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue; break; } return $theValue;}$editFormAction = $_SERVER['PHP_SELF'];if (isset($_SERVER['QUERY_STRING'])) { $editFormAction .= "?" . htmlentities($_SERVER['QUERY_STRING']);}if ((isset($_POST["MM_insert"])) && ($_POST["MM_insert"] == "form3")) { $insertSQL = sprintf("INSERT INTO login (firstname, username, address, password, zipcode, `state`, lastname, email, city) VALUES (%s, %s, %s, %s, %s, %s, %s, %s, %s)", GetSQLValueString($_POST['firstname'], "text"), GetSQLValueString($_POST['username'], "text"), GetSQLValueString($_POST['address'], "text"), GetSQLValueString($_POST['password'], "text"), GetSQLValueString($_POST['zipcode'], "text"), GetSQLValueString($_POST['state'], "text"), GetSQLValueString($_POST['lastname'], "text"), GetSQLValueString($_POST['email'], "text"), GetSQLValueString($_POST['city'], "text"));//if ((isset($_POST["MM_insert"])) && ($_POST["MM_insert"] == "form1")) { $insertSQL = sprintf("INSERT INTO membershipcategory (mem_id, price, datesign,) VALUES (%s, %s,%s)", GetSQLValueString($_POST['mem_id'], "value"), GetSQLValueString($_POST['username'], "text"), GetSQLValueString($_POST['address'], "text"), GetSQLValueString($_POST['password'], "text"), GetSQLValueString($_POST['zipcode'], "text"), GetSQLValueString($_POST['state'], "text"), GetSQLValueString($_POST['lastname'], "text"), GetSQLValueString($_POST['email'], "text"), GetSQLValueString($_POST['city'], "text"));// mysql_select_db($database_jobs, $jobs); $Result1 = mysql_query($insertSQL, $jobs) or die(mysql_error());if $insert <?php echo 'Welcome'.$_SESSION['MM_Username'].'you are now a member';?> ?> ok this is what I tried, dont laugh, it didnt work and Im not surprised but am I even close? Thanks, Michelle Quote Link to comment https://forums.phpfreaks.com/topic/4245-submit-on-page-load/#findComment-14889 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.