Data not saved

kev

Member
There is:
if ( isset( $_REQUEST['opt1'] ) && !empty( $_REQUEST['opt1'] ) ) { $opt1 = $_REQUEST['opt1']; }

I've added below the original code:

<tr height="24">
<td width="183" height="24"><div align="right" class="style8"> <font size="-1" face="Verdana">Post Code</font></div></td>
<td width="22" height="24"></td>
<td height="24"><input type="text" name=opt1" size="30" <?php echo " value=\"$opt1\""; ?> /></td>
<td height="24"><span class="style12">Required</span></td>

The data is not saved to my sql table.
 

kev

Member
I'm trying to alter one of the signup template files to add another field. I need subscribers to a particular list add their post code as well as their name and email.
 

stanbusk

Administrator
Staff member
You need to add the Opt1 to the call to lm.php on that same page. Look for:
Code:
if ( count( $errors ) == 0 ) {
		$url = $lm_path . "?cmd=$cmd&list=$list&email=$email&firstname=$firstname&lastname=$lastname";
		header("Location: $url");
	}
It should be something like:
Code:
if ( count( $errors ) == 0 ) {
		$url = $lm_path . "?cmd=$cmd&list=$list&email=$email&firstname=$firstname&lastname=$lastname&opt1=$opt1";
		header("Location: $url");
	}
See 'opt1' added to the URL as $opt1 ?
 

kev

Member
This was already there when I checked the file...

if ( count( $errors ) == 0 ) {
$url = "../lm.php";
$url .= "?cmd=$cmd&list=$list&email=$email&firstname=$firstname&lastname=$lastname&company=$company&opt1=$opt1";
header("Location: $url");
}

The code looks different in the newer files supplied with LM than some that I customised a few years back. I've tried to alter the latest version of 'subscribe_single_fixed', but it keeps asking for a field to be filled in. I can't see what the problem is.

Can I email you the file to have a look at?
 
Top