What is JotForm?
JotForm is a free online form builder which helps you create online forms without writing a single line of code. No sign-up required.

At JotForm, we want to make sure that you’re getting the online form builder help that you need. Our friendly customer support team is available 24/7.

We believe that if one user has a question, there could be more users who may have the same question. This is why many of our support forum threads are public and available to be searched and viewed. If you’d like help immediately, feel free to search for a similar question, or submit your question or concern.

  • Profile Image

    Attaching WP username to form submission using custom insert PHP code no longer working

    Asked by ccranney on November 25, 2014 at 05:35 AM

    Hi guys.


    I have a form on my website which I have a hidden field on that captures the logged in username and attaches it to the form. Now this is no longer working and instead the following information is being transferred to the form:


    [insert_php] global $current_user; get_currentuserinfo(); echo $current_user->user_login; [/insert_php]!


    Code I have used in iframe:


    <iframe id="JotFormIFrame" style="width: 100%; height: 1011px; border: none;" src="//form.jotformeu.com/form/40753265708357?username32=[insert_php] global $current_user; get_currentuserinfo(); echo $current_user-&gt;user_login; [/insert_php]" width="100%" height="1020px" frameborder="0" scrolling="no"></iframe>

    <script type="text/javascript">// <![CDATA[

    window.handleIFrameMessage = function(e) {var args = e.data.split(":");var iframe = document.getElementById("JotFormIFrame");if (!iframe)return;switch (args[0]) {case "scrollIntoView":iframe.scrollIntoView();break;case "setHeight":iframe.style.height = args[1] + "px";break;}};if (window.addEventListener) {window.addEventListener("message", handleIFrameMessage, false);} else if (window.attachEvent) {window.attachEvent("onmessage", handleIFrameMessage);}

    // ]]></script>


    Any ideas how I can resolve this problem? Thanks in advance.

    Page URL:

  • Profile Image
    JotForm Support

    Answered by jonathan on November 25, 2014 at 08:31 AM


    From your original post here https://www.jotform.com/answers/357275 where you have created this custom solution, can you please double check if the plugin insert PHP is working?


    that can be the possible cause why the PHP code is no longer executing within your WP page.

    Hope this help. Please update us if still not resolve.




  • Profile Image

    Answered by ccranney on November 26, 2014 at 04:05 AM

    You're the man Jonathan!