MLM - how to add opt1,2,3… to existing templates

nicolasbulb

New Member
I'd like to add opt3 I'm using for "country+" into the "subscribe_single_fixed.php" template.

How do I do that?

Many thanks.

N.
 

stanbusk

Administrator
Staff member
You just need to add a new field to the form, call it 'country' for example and then modify the PHP code so the field is sent to the script. First you have to add this line to the ISSET lines (after line 7):

if ( isset( $_REQUEST['country'] ) && !empty( $_REQUEST['country'] ) ) { $Country = $_REQUEST['country']; }

Then replace:

$url .= "?cmd=$cmd&list=$list&email=$email&firstname=$firstname&lastname=$lastname";

with

$url .= "?cmd=$cmd&list=$list&email=$email&firstname=$firstname&lastname=$lastname&opt3=$country";
 

nicolasbulb

New Member
Ok, I did that but I can't see the opt3 in my SQL database under my "fld_opt3".

And by the way, why does MLM creates a second table "tbl_mlm_sub"? What does it means?


Thx.
 

stanbusk

Administrator
Staff member
In fact the field would be 'fld_opt3'. MLM only uses one single copy of 'tbl_mlm_sub'. What is the name of the other table you have?
 

nicolasbulb

New Member
In the database I have:
tbl_mlm_sub
tbl_mlm_users

The "tbl_mlm_users" should be the list I'm using. This is the one I've uploaded the current list I have.
Both of them having "fld_list" = "CX_mailing_all" .

"Posted: Fri Nov 21, 2008 3:56 pm Post subject:
In fact the field would be 'fld_opt3'. "

Where do I define the name?
I still don't understand the nomination to put the data of "country" to the database.

Here's the code I have now:
<?php

if ( isset( $_REQUEST['cmd'] ) && !empty( $_REQUEST['cmd'] ) ) { $cmd = $_REQUEST['cmd']; }
if ( isset( $_REQUEST['email'] ) && !empty( $_REQUEST['email'] ) ) { $email = $_REQUEST['email']; }
if ( isset( $_REQUEST['list'] ) && !empty( $_REQUEST['list'] ) ) { $list = $_REQUEST['list']; }
if ( isset( $_REQUEST['firstname'] ) && !empty( $_REQUEST['firstname'] ) ) { $firstname = $_REQUEST['firstname']; }
if ( isset( $_REQUEST['lastname'] ) && !empty( $_REQUEST['lastname'] ) ) { $lastname = $_REQUEST['lastname']; }
if ( isset( $_REQUEST['city'] ) && !empty( $_REQUEST['city'] ) ) { $city = $_REQUEST['city']; }
if ( isset( $_REQUEST['country'] ) && !empty( $_REQUEST['country'] ) ) { $country = $_REQUEST['country']; }

if ( isset( $submit ) ) {
$errors = array();
if ( $email == "" ) { $errors[] = "Enter your email address in the email address text box"; $wrong['email'] = TRUE; }
if ( $email !== "" && ( stristr( $email, "." ) == FALSE || stristr( $email, "@" ) == FALSE ) ) { $errors[] = "The e-mail address you have entered is not valid"; $wrong['email'] = TRUE; }
if ( $firstname == "" ) { $errors[] = "Enter your fist name in the fist name text box"; $wrong['firstname'] = TRUE; }
if ( $lastname == "" ) { $errors[] = "Enter your last name in the last name text box"; $wrong['lastname'] = TRUE; }

if ( count( $errors ) == 0 ) {
$url = "../mlm.php";
$url .= "?cmd=$cmd&list=$list&email=$email&firstname=$firstname&lastname=$lastname&opt2=$city&opt3=$country";
header("Location: $url");
}
}

?>
 

stanbusk

Administrator
Staff member
Your code looks correct, I guess the problem is the form field then. Are you sure it is names 'country'?
 

nicolasbulb

New Member
Here's the code I'm using to inline the form to my actual website contact page:

</tr>
<tr height="24">
<td width="40%" height="24">
<div align="right">
<font size="-2" color="#000000" face="Verdana"><b>Votre ville</b></font></div>
</td>
<td width="15" height="24"></td>
<td height="24"><input type="text" name="opt2" size="30" <?php echo " value=\"$city\""; ?> /></td>
</tr>
<tr height="24">
<td width="40%" height="24">
<div align="right">
<font size="-2" color="#000000" face="Verdana"><b>Votre pays</b></font></div>
</td>
<td width="15" height="24"></td>
<td height="24"><input type="text" name="opt3" size="30" <?php echo " value=\"$country\""; ?> /></td>
</tr>
 

nicolasbulb

New Member
Very fine but how come in your original code lastname comes with "$lastname"?



<tr height="24">
<td width="40%" height="24">
<div align="right">
<font size="-1" color="#0059a5" face="Verdana"><b>Your Last Name</b></font></div>
</td>
<td width="15" height="24"></td>
<td height="24"><input type="text" name="lastname" size="30" <?php echo " value=\"$lastname\""; ?> /></td>
<td height="24"><font size="-2" color="#ff9c9c" face="Geneva,Arial,Helvetica,sans-serif">Required</font></td>
</tr>
 

stanbusk

Administrator
Staff member
'lastname' is the name of the field. '$lastname' is a PHP parameter. They are two different things. The line:

if ( isset( $_REQUEST['lastname'] ) && !empty( $_REQUEST['lastname'] ) ) { $lastname = $_REQUEST['lastname'];

assigns the value of the 'lastname' field to the PHP variable $lastname.
 
Top