Jump to content

Archived

This topic is now archived and is closed to further replies.

Plazman65

Submit on page load

Recommended Posts

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 from
select 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

Share this post


Link to post
Share on other sites
<?php
function 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

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.