<table id="content" width="100%" border="0" cellspacing="0" cellpadding="0">
                    <tr> 
                      <td>
           <?php
			if  (isset($_POST['submit2'])) {
			$emailnl;
			$sql="DELETE FROM nlmembers WHERE email='$email'";
			$result = mysql_query($sql);
?>
                <?php echo $textnl2 ?> 
    <?php } else { ?>
 
    <?php require_once 'fprotect.php'; ?>
           
    <?php 
	if  (isset($_POST['submit'])) {
    $name=safe($name); 
	$address=safe($address);
	$city=safe($city);
    $country=safe($country); 
    $tel=safe($tel); 
    $email=safe($email); 
    $comments=safe($comments); 
    $code1=safe($code1); 
	?>
	
   	<?php
if (preg_match("/a href/i", "$comments")) {
?> 
<?php } else { ?>

<?php if ($data==$_POST['code1']) { ?>

<?php 
      $memberid;
	  $sql1="UPDATE nlmembers SET name='$name', email='$email', address='$address', city='$city', tel='$tel', comments='$comments' WHERE id='$memberid'";
	  $result1 = mysql_query($sql1);
?>
                      </td>
                    </tr>
                    <tr> 
                      <td> 
               <?php echo $textnl3 ?> 
                     </td>
                    </tr>
                    <tr> 
                      <td>
                       <?php } else { ?>
                      
                      </td>
                    </tr>
                    <tr> 
                      <td>
                      <?php echo $ftext2 ?>
                      </td>
                    </tr>
                    <tr> 
                      <td> 
                        <?php } ?>
                        <?php } ?>
                        <?php } else { ?>
                        <?php
			$sql2="SELECT  * FROM nlmembers WHERE email='{$_REQUEST['emailnl']}'";
			$result2 = mysql_query($sql2);
			$myrow=mysql_fetch_array($result2);
			$id=$myrow[id];
			$name=$myrow[name];
			$emailold=$myrow[email];
			$address=$myrow[address];
			$city=$myrow[city];
			$tel=$myrow[tel];
			$comments=$myrow[comments];
			
			if  ($emailold == "" AND $emailnl!="") {
				$sql3 = "INSERT INTO nlmembers (email, category_id) VALUES ('$emailnl', '1')";
				$result3 = mysql_query($sql3);
				
				$sql4="SELECT * FROM nlmembers WHERE email='{$_REQUEST['emailnl']}'";
				$result4 = mysql_query($sql4);
				$myrow=mysql_fetch_array($result4);
				$id=$myrow[id];
			}
?>
                      </td>
                    </tr>
                    <tr> 
                    
                        <td>
                        <form name="forma" method="post" action="">	
                        <input type="hidden" name="memberid" value="<?php echo $id?>">
                          <table width="100%" border="0" cellpadding="0" cellspacing="2">
                            <tr valign="top"> 
                              <td>
                                <?php echo $field1 ?>*
                              </td>
                              <td><input name="name" type="text" class="forms" id="name" value="<?php echo $name?>" size="30" maxlength="100"></td>
                            </tr>
                            <tr valign="top"> 
                              <td>
                                <?php echo $field2 ?>   
                              </td>
                              <td><input type="text" name="address" size="30" value="<?php echo $address ?>" class="forms" maxlength="100"></td>
                            </tr>
                            <tr valign="top"> 
                              <td>
                                <?php echo $field3 ?>   
                              </td>
                              <td><input type="text" name="city" size="30" value="<?php echo $city ?>" class="forms" maxlength="100"></td>
                            </tr>
                            <tr valign="top"> 
                              <td>
                                <?php echo $field5 ?> 
                              </td>
                              <td><input type="text" name="tel" size="30" value="<?php echo $tel ?>" class="forms" maxlength="50"></td>
                            </tr>
                            <tr valign="top">
                              <td>E-mail*</td>
                              <td><input name="email" type="text" class="forms" id="email" value="<?php echo $emailnl ?>" size="30" maxlength="60"></td>
                            </tr>
                            <tr valign="top">
                            <td>
               <?php echo $field6 ?>                            
                            </td>
                              <td><textarea name="comments" id="comments" class="forms" rows="6" cols="23"><?php echo $comments ?></textarea></td>
                            </tr>
                            <tr valign="top">
                              <td>
 <?php echo $ftext3 ?>
 <?
global $data;
$data = mt_rand(100000,1000000);
?>
    <input type="hidden" name="code1" value="<?php echo $code1 ?>">
    <input type="hidden" name="data" value="<?php echo $data ?>">                             

                                  </td>
                              <td>
    <img src="/includes/dynamicimage.php?dt=<? global $data; echo base64_encode($data);?>" alt="">                                
    <input type="text" name="code1" id="code1" size="16" class="forms" maxlength="6"></td>
                            </tr>
                            <tr valign="top">
                              <td>
               * <?php echo $fieldr ?>
                              </td>
                              <td>
<input name="submit" type="submit" class="button" onClick="MM_validateForm('name','','R','email','','RisEmail');return document.MM_returnValue" value="<?php echo $button2 ?>">
<input type="submit" name="submit2" value="<?php echo $button3 ?>" class="button">                              
                              </td>
                            </tr>
                          </table>
						  </form>
                        
                        </td>
                    </tr>
                    <tr> 
                      <td> 
              <?php } ?>
              <?php } ?>
                </td>
                    </tr>
                  </table>