0

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]);
     } 
  }
?>

Edited by Dani: Formatting fixed

3
Contributors
3
Replies
4
Views
7 Years
Discussion Span
Last Post by diafol
0

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()
{

!!!

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.