Plugin Beauty Contact Popup Form with while loop

If I understood correctly, you want the html in the link inside the loop, in that case it would be best to terminate the php script with ?> paste your HTML and start the php script again.

this would look like this:

<?php
// keeps getting the next row until there are no more to get
while($row = mysql_fetch_array( $result )) {
    // Print out the contents of each row into tabs
         echo "<div class="tab-tall"><ul id='tab"; echo htmlspecialchars($row['layouttype']); echo "'>
          <li><a style="font-size:;" class="textBig heading">"; echo htmlspecialchars($row['heading']); echo "</a></li>
          <li><a style="font-size:;" class="textBig supplier">"; echo htmlspecialchars($row['supplier']); echo "</a></li>
          <li><a style="font-size:;" class="url" target="_blank">"; echo htmlspecialchars($row['url']); echo "</a></li>";
          ?>
          <li>
          <a class="email" href="https://wordpress.stackexchange.com/questions/190449/javascript:TagPopup_OpenForm("TagPopup_FormContainer","TagPopup_FormContainerBody","TagPopup_FormContainerFooter");"><?php htmlspecialchars($row['email']); ?></a><div style="display: none;" id="TagPopup_FormContainer"><div id="TagPopup_FormContainerHeader"><div id="TagPopup_FormClose"><a href="javascript:TagPopup_HideForm('TagPopup_FormContainer','TagPopup_FormContainerFooter');">X</a></div><div id="TagPopup_FormTitle">  Wanted Ad Reply </div></div><div id="TagPopup_FormContainerBody"><form action="#" name="TagPopup_Form" id="TagPopup_Form"><div id="TagPopup_FormAlert"> <span id="TagPopup_alertmessage"></span> </div><div id="TagPopup_FormLabel_Page"><input name="TagPopup_name" class="TagPopup_TextForm" type="text" id="TagPopup_name" Placeholder="Your Name" maxlength="120"></div><div id="TagPopup_FormLabel_Page"><input name="TagPopup_mail" class="TagPopup_TextForm" type="text" id="TagPopup_mail"  Placeholder="Your Email" maxlength="120"></div><div id="TagPopup_FormLabel_Page"><textarea name="TagPopup_message" class="TagPopup_TextArea" rows="3" id="TagPopup_message"  Placeholder="Enter Your Message"></textarea></div><input type="hidden" id="TagCorrectsum" name="TagCorrectsum" value="11"/><div id="TagPopup_FormLabel_Page" class="TagPopup_Human" > Verify Human: 3 + 8 = </div><input name="TagPopup_captcha" class="TagPopup_TextForm" type="text" id="TagPopup_captcha"  Placeholder="Enter the sum eg: 1+1=2" maxlength="120"><div id="TagPopup_FormLabel_Page"><input type="button" name="button" class="TagPopup_Button" value="Submit" onClick="javascript:TagPopup_Submit(this.parentNode,'http://www.mewanted.com');"></div></form></div></div><div style="display: none;" id="TagPopup_FormContainerFooter"></div></a>
          </li>
          <?php 
          echo "<li><a style="font-size:;" class="summary"'>"; echo htmlspecialchars($row['summary']); echo "</a></li>
          <li><a class="img relink"><img src=""; echo htmlspecialchars($row["linked_image']); echo "' /></a></li>
          </ul></div>"; 
}
?>