The code is posted below, the problem is that i get a parse error at line 80 (last line) and i cannout see why from my point is correct. Thanks.

<?php

function select_($sql,$select_name,$selected_value,$initial_value,$val1,$val2,$post) 
{



$result=mysql_query($sql);


?>
<select name="<? print $select_name;?>">
<?
   if(!empty($post))
   {
      while($row=mysql_fetch_array($result))
    {
        print'<option ';
        if($row[$val1]==$post)
      {
        print'selected="selected"';
      }

       print'<option ';
       print'value="';
       print $row[$val1];
       print'">';
       print $row[$val2];
       print'</option>';
    }

   }

   elseif(!empty($initial_value))
   {
   print'<option value="" selected="selected">'.$initial_value.'</option>';
   while($row=mysql_fetch_array($result))
   {
       print'<option ';
       print'value="';
       print $row[$val1];
       print'">';
       print $row[$val2];
       print'</option>';
   }
   }
   else
   {
   while($row=mysql_fetch_array($result))
{
   print'<option ';
   if($row[$val1]==$selected_value)
   {
     print'selected="selected"';
   }

       print'<option ';
       print'value="';
       print $row[$val1];
       print'">';
       print $row[$val2];
       print'</option>';
}
}
print'</select>';
?>
<?
}
?>

<?
  function iesire()
  {
     foreach($_SESSION as $key=>$value)
     {
       unset($_SESSION[$key]);
     } 
  }
?>
Member Avatar for diafol

Use code tags, I can't follow this. You may want to use full php tags (<?php...?>) as opposed to short ones. You have loads of opne/close php tags - I can't see why you feel the need for this.

e.g.

print'</select>';
?>
<?
}
?>

<?
function iesire()
{

!!!

why dont you post the whole error once ?

Member Avatar for diafol

OP left the building?

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.