带有While循环的Plugin Beauty联系人弹出表单

时间:2015-06-04 作者:Stephen Chernishov

我已经在我的网站上安装了Beauty Contact弹出表单Wordpress插件,并希望在mysql\\u fetch\\u array循环中使用原始源代码(或更好的方式访问表单),如下所示:

<?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>"; 
}
?>
我在想,调整插件发出的原始html,然后以某种方式将其添加到提取电子邮件[\'email\']中-

<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>

2 个回复
SO网友:filype

如果我理解正确,您希望html位于循环内的链接中,在这种情况下,最好使用?> 粘贴HTML并再次启动php脚本。

这看起来像这样:

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

SO网友:Stephen Chernishov

//我发现我可以将下面的代码直接放入美容联系人弹出表单中。php,并使表格工作以及美丽的弹出窗口。然后考虑通过编辑mysql\\u fetch\\u数组结果和@wp\\u邮件来调整现有插件以运行。

//但愿我知道更多。他熬夜了半天,希望弄明白如何通过下面的脚本循环联系人弹出式表单,该脚本从数据库中提取联系人详细信息并显示出来(将“echo htmlspecialchars($row[\'email])”);将“echo”替换为指向弹出式表单和电子邮件不同内容的链接)。下面是获取数组代码-

  • “echo htmlspecialchars($行[\'heading]);echo“
  • ”;echo htmlspecialchars($行[\'supplier]);echo“”;echo htmlspecialchars($行[\'url]);echo“”;echo htmlspecialchars($行[\'email]);echo“”;echo htmlspecialchars($行[\'summary]);echo“”;///打赌其他人知道一种简单的方法

    结束

    相关推荐

    Storing user submitted forms

    我想知道创建一个只有注册用户才能看到的表单的最佳方法是什么。我想在这里实现的主要想法是让用户登录并访问一个页面,其中有一个可以多次提交的申请表。每个表单将存储在数据库中并与用户关联。它还可以选择将文件附加到系统。在WP仪表板中,管理员可以浏览系统中的所有用户,并查看他们提交的所有应用程序。是否最好在仪表板中创建一个自定义选项卡并显示每个用户?表单数据是否会被分类为每个用户的元数据?我对如何开发这个有点困惑,如果有任何建议,我将不胜感激。