Jump to content

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
Link to comment
https://forums.phpfreaks.com/topic/4245-submit-on-page-load/
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
Link to comment
https://forums.phpfreaks.com/topic/4245-submit-on-page-load/#findComment-14889
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

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.