Form and multiple selection field

chris.modlao

New Member
Hi,
I'm trying to do a multiple select form as you see below
Code:
<select type="text" name="title" class="texte obligatoire" >
                                                    <option value=""></option>
                                                        <option value="Mr">Mr</option>
                                                        <option value="Mrs">Mrs</option>
                                                        <option value="Ms">Ms</option>
                                                        <option value="Prof">Prof</option>
                                                        <option value="Dr">Dr</option>
                                                     <?php echo " value=\"$opt1\""; ?> </select>

What hapopend is that everytime i fill the form MLM return me this line
Code:
Sorry but we can't process your request
Please fix the following issues
Enter your title in the first name text box

I try to place to different place the PHP sentence :
Code:
<?php echo " value=\"$opt1\""; ?>
but still the same problem.

Any idea?

Regards

Chris
 

stanbusk

Administrator
Staff member
This problem comes from the error checker on top of the page. You will see that there is code to check each data passed to the script. I think one of the line is wrong.
 

chris.modlao

New Member
Hi,

I try to check the code of the error checker and it seems to be OK :
Here is the first lines :
Code:
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']; } else { $list = "list1"; }
if ( isset( $_REQUEST['firstname'] ) && !empty( $_REQUEST['firstname'] ) ) { $firstname = $_REQUEST['firstname']; }
if ( isset( $_REQUEST['lastname'] ) && !empty( $_REQUEST['lastname'] ) ) { $lastname = $_REQUEST['lastname']; }
if ( isset( $_REQUEST['title'] ) && !empty( $_REQUEST['title'] ) ) { $lastname = $_REQUEST['title']; }
And here the code checker:
Code:
if ( isset( $_REQUEST['submit'] ) ) {
	$errors = array();
	if ( $opt1 == "" ) { $errors[] = "Enter your title in the first name text box"; $wrong['title'] = TRUE; }
	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 first name in the name text box"; $wrong['firstname'] = TRUE; }
	if ( $lastname == "" ) { $errors[] = "Enter your last name in the name text box"; $wrong['lastname'] = TRUE; }
	
	if ( count( $errors ) == 0 ) {
		$url  = "../lm.php";
		$url .= "?cmd=$cmd&list=$list&email=$email&firstname=$firstname&lastname=$lastname&opt1=$opt1";
		header("Location: $url");
	}

Any idea?

Chris
 

chris.modlao

New Member
Hello,


Problem solved!
I forget to change something in the first line while i was copying/past it :
Code:
if ( isset( $_REQUEST['title'] ) && !empty( $_REQUEST['title'] ) ) { $lastname = $_REQUEST['title']; }
by
Code:
if ( isset( $_REQUEST['title'] ) && !empty( $_REQUEST['title'] ) ) { $opt1 = $_REQUEST['title']; }

Thanks men

Chris
 
Top