title: Dynamic link in IF/ELSE statement
body: <p>I apologize for any misuse of terminology...I'm a noob... </p>
  
  <p>I have a dynamically created page that contains a dynamic link. I added an IF/ELSE statement to display a different word based on the number of items in the variable $rowsphoto.</p>
  
  <p>The different words display correctly, but the URL that is generated contains all of the PHP instead of generating the correct URL.</p>
  
  <p>This is the original code, which works fine:</p>
  
  <pre><code>&lt;?php if($portfolioid != 0) { ?&gt;
      &lt;div class="extrafield"&gt;Additional works in &lt;a href="index.php?option=com_jartists&amp;view=portfolio&amp;aid=&lt;?php echo $artistid;?&gt;&amp;pid=&lt;?php echo $portfolioid; ?&gt;&amp;album=&lt;?php echo $albumid;?&gt;&amp;id=&lt;?php echo $photoidd; ?&gt;&amp;Itemid=105" class="portfoliocol"&gt;Portfolio:&lt;/a&gt;&lt;/div&gt;
  </code></pre>
  
  <p>This is the code I have after adding the IF/ELSE statement:</p>
  
  <pre><code>&lt;?php if($portfolioid != 0) { ?&gt;
      &lt;div class="extrafield"&gt;    
  &lt;?php
  if ($rowsphoto &lt;= 4){
      echo "Additional works in &lt;a href='index.php?option=com_jartists&amp;view=portfolio&amp;aid=&lt;?php echo $artistid;?&gt;&amp;pid=&lt;?php echo $portfolioid; ?&gt;&amp;album=&lt;?php echo $albumid;?&gt;&amp;id=&lt;?php echo $photoidd; ?&gt;&amp;Itemid=105' class='portfoliocol'&gt;Edition:&lt;/a&gt;";
  } else {
      echo "Additional works in &lt;a href='index.php?option=com_jartists&amp;view=portfolio&amp;aid=&lt;?php echo $artistid;?&gt;&amp;pid=&lt;?php echo $portfolioid; ?&gt;&amp;album=&lt;?php echo $albumid;?&gt;&amp;id=&lt;?php echo $photoidd; ?&gt;&amp;Itemid=105' class='portfoliocol'&gt;Portfolio:&lt;/a&gt;";
  }                          
  ?&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>I ran the code through a couple syntax checks and they all came back with no errors. What am I doing wrong? Is this even possible?</p>