when i run this code it give error unexpected else please suggest mi how to write it : <p>when i run this code it give error unexpected else please suggest mi   how to write it i am confused with open and close bracket</p>

<pre><code>     &lt;?php
     } 

     for ($i = $start_loop; $i &lt;= $end_loop; $i++) 
     {

    //if ($cur_page == $i)
    if($i != $page)?&gt;

     &lt;a href="javascript:callonce_search( &lt;?php echo $i?&gt;,'&lt;?php echo        $txt?&gt;')"&gt; $i &lt;/a&gt;



  &lt;?php 
    else
      echo " &lt;a class='paginationcurrnt'&gt;&lt;b&gt; $i&lt;/b&gt;";
     }


    // TO ENABLE THE NEXT BUTTON
   if ($next_btn &amp;&amp; $cur_page &lt; $no_of_paginations) 
    {
    $nex = $cur_page + 1; ?&gt;
</code></pre>
