-1

I have installed the Beauty Contact Popup Form Wordpress Plugin on my website, and want to use the raw source code (or a better way to access the form) in a mysql_fetch_array loop 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 style='font-size:;' class='email' target='_top'>"; echo htmlspecialchars($row['email']); echo "</a></li>
          <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>"; 
}
?>

I am thinking, adapt the raw html that the plugin spits out like is, then add it to the fetch email ['email'] somehow -

<a class='email' href='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>
  • 1
    Don't abuse echo, build a proper string, and save it to a variable, and right at the end echo the variable – Pieter Goosen Jun 4 '15 at 8:47
  • Hi Pieter, Thanks for the comment. So - can I edit beauty-contact-popup-form/beauty-contact-popup-form.php to somehow talk directly with my page somehow? (for example, put the connection and all loop fetch array code into the plugin and grab all of the content like this?: <?php echo do_shortcode('[show_tagwebs_beauty_contact_popup_form id="1"]'); ?> I'm learning\beginning – Stephen Chernishov Jun 5 '15 at 14:04
0

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='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>"; 
}
?>
0

// I figured out that I can put the code below directly into beauty-contact-popup-form.php and have the table working as well as Beauty Popup. Then thought to adapt existing plugin to run through by editing mysql_fetch_array results and @wp_mail somehow.

// Wish I knew more. Been up half he night hoping to figure out how to loop the Contact Popup Form through the script below, which pulls contact details from database and displays (replacing "; echo htmlspecialchars($row['email']); echo " with a link that goes to popup form and emails different contects). Here is a the fetch array code -

  • "; echo htmlspecialchars($row['heading']); echo "
  • "; echo htmlspecialchars($row['supplier']); echo "
  • "; echo htmlspecialchars($row['url']); echo "
  • "; echo htmlspecialchars($row['email']); echo "
  • "; echo htmlspecialchars($row['summary']); echo "
  • "; } ?>

    // Bet someone else knows a simple way

    Your Answer

    By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

    Not the answer you're looking for? Browse other questions tagged or ask your own question.