If else statement with two conditions
<p>Is it possible to have an if esle statement with two conditions?, </p>

<p>I have this code...</p>

<pre><code> if ($current_page == 1)
</code></pre>

<p>however could i write it so it was something like this </p>

<pre><code> if ($total_pages ==1 $current_page &lt; $total_pages)
</code></pre>

<p>Have tried to write this several ways myself, but can not seem to get it to work.</p>

<p>Any ideas would be appreciated,</p>

<p>Code</p>

<pre><code> echo "$current_page"; echo "$total_pages";

     if ($current_page &gt;= 1 &amp;&amp; ($current_page &lt; $total_pages)) { echo "next button should be here"; } else {echo "Nothing"; }
</code></pre>

<p>please see link below, you can see that it is page 1 of 4 and it gets to the nothing section.  when it should show next button here.</p>

<p><a href="http://www.qrrw.net/k" rel="nofollow">http://www.qrrw.net/k</a></p>

<p>Php Code</p>

<pre><code> $pageNum = $_GET['page'];
  $engine = $_GET['engine'];
  $manid = $_GET['manid'];
  $mgid = $_GET['mgid'];
  $file = 'http://mywebsite.com/page.xml?apikey=****&amp;vid=****&amp;limit=10&amp;mgid='. $mgid.'&amp;engine='. $engine.'&amp;manid='.$manid.'&amp;page=' . $pageNum;

  if(!$xml = simplexml_load_file($file))
   exit('Failed to open '.$file);

  $total_pages = $xml-&gt;results-&gt;attributes()-&gt;totalPages;
  $current_page = $xml-&gt;results-&gt;attributes()-&gt;currentPage;
  $total_results = $xml-&gt;results-&gt;attributes()-&gt;totalResults;

  $count = 0;
  $max = 2;
  foreach($xml-&gt;year as $year){ 

  $count++;
  echo '&lt;td class="manu"&gt;'. "&lt;a href='exact.php?manid=".$manid."&amp;engine=".$engine."&amp;mgid=".$mgid."&amp;year=".$year['name']."'&gt;".$year['name']."&lt;/a&gt;";'   &lt;/td&gt;';

 if($count &gt;= $max){

 $count = 0;

 echo '&lt;/tr&gt;&lt;tr&gt;';
 }
 }
 $pageNum = $current_page = $xml-&gt;results-&gt;attributes()-&gt;currentPage;

 if ($current_page == 1) { } else {
    echo "&lt;a href='years.php?page=".($pageNum - 1)."&amp;engine=".($engine)."&amp;manid=".($manid)."&amp;mgid=".($mgid)."'&gt;&lt;img src='../images/previous.fw.png' width='130' height='92' /&gt;&lt;/a&gt;";
    }

    echo "$current_page"; echo "$total_pages";

    if ($current_page &gt;= 1 &amp;&amp; ($current_page &lt; $total_pages)) { 
    echo "next button should be here"; 
    } else {
    echo "Nothing";  
</code></pre>
