Code Form Into Wordpress Page - Not...

User 2396634 Photo


Registered User
12 posts

I currently have a Wordpress site and am accessing the form I built with Web Form Builder through an iFrame on the page. I would rather directly code the form into the Wordpress page (edited within Wordpress), so that the form can be directly integrated with Wordpress and also not be accessed by people just typing in the html address.

The site is a member only site on certain pages and the page where the form is to be accessed should be blocked access, except for logged in members. I am wanting to minimize access to the form and submit a hidden value with the form that recognizes the logged in user id and user name. I am hoping that if there is some way to get rid of the html access and have the form be directly coded on the page, that I'll be able to transfer values to the form for users and implement the member restriction on the page.

The iFrame is coded like this in the Wordpress page (I've adjusted my domain name for confidentiality):

<center><script type="text/javascript">// <![CDATA[
document.write(unescape("%3Ciframe src=\"http://MyDomain.com/Idea%2520Submission/Idea%2520Submission.html\" width=\"650\" height=\"2870\"allowtransparency=\"true\" scrolling=\"no\" frameborder=\"0\"%3E&lt;a href=\"Idea%2520Submission.php\" title=\"Idea%2520Submission\"&gt;Check out my CoffeeCup Form&lt;/a&gt;%3C/iframe%3E"));
// ]]></script></center><noscript>&amp;amp;lt;iframe width="650" height="2870" style="border:none; background:transparent; overflow:hidden;" src="http://MyDomain.com/Idea%20Submission/Idea%20Submission.html"&amp;amp;gt;&amp;amp;lt;br /&amp;amp;gt; &amp;amp;amp;lt;a href="Idea%20Submission.php" title="Idea%20Submission"&amp;amp;amp;gt;Check&amp;amp;lt;br /&amp;amp;gt; out my CoffeeCup Form&amp;amp;amp;lt;/a&amp;amp;amp;gt;&amp;amp;lt;br /&amp;amp;gt; &amp;amp;lt;/iframe&amp;amp;gt;&amp;amp;lt;br /&amp;amp;gt;</noscript>

An FYI for how I am trying to access the user ID values is by putting this in the header.php of Wordpress:

<?php global $current_user;
get_currentuserinfo();
?>

When I print the statements:

echo 'Username: ' . $current_user->user_login . "\n";
echo 'User ID: ' . $current_user->ID . "\n";

It shows the correct info in the header, but cannot access these values currently in the html file and submission.


In the hidden value section of Web Form Builder I placed:

Name: User_ID Value: <?php echo $current_user->ID; ?>
Name: User_Login Value: <?php echo $current_user->user_login; ?>


If you can help directly code the page or know why the user info is not being submitted with the form, I'd really appreciate your help.

Thanks,
Brad
User 187934 Photo


Senior Advisor
20,193 posts
Online Now

The form is already loaded through an iframe. Take a close look at the script that the form builder provides.:)
I can't hear what I'm looking at.
It's easy to overlook something you're not looking for.

This is a site I built for my work.(RSD)
http://esmansgreenhouse.com
This is a site I built for use in my job.(HTML Editor)
https://pestlogbook.com
This is my personal site used for testing and as an easy way to share photos.(RLM imported to RSD)
https://ericrohloff.com
User 2396634 Photo


Registered User
12 posts

Yeah, I'm trying not to load it in an iFrame. Would like to code it directly through the Wordpress page. Don't want any html access to the form.

Thanks.
User 187934 Photo


Senior Advisor
20,193 posts
Online Now

I have a form and I altered it after publishing by adding a redirect php script to the head of the page checking if a user was logged in. You could do this with a cookie also. You could do the same if you have a protection script in your word press page. You could also use a referer script checking if a user came from a particular url. If they came from a protected url then allow them to see it if not redirect.
I can't hear what I'm looking at.
It's easy to overlook something you're not looking for.

This is a site I built for my work.(RSD)
http://esmansgreenhouse.com
This is a site I built for use in my job.(HTML Editor)
https://pestlogbook.com
This is my personal site used for testing and as an easy way to share photos.(RLM imported to RSD)
https://ericrohloff.com
User 2396634 Photo


Registered User
12 posts

Correct me if I'm wrong, but with having the form load as an iFrame there will be no way to have my SSL certificate act to fully encrypt the page and submission? Therefore, not displaying the full encryption seal in the browser bar for the SSL.
User 187934 Photo


Senior Advisor
20,193 posts
Online Now

I'm not that familiar with SSL, but I would think you could try it. After all the form is on the same server and domain correct?
I can't hear what I'm looking at.
It's easy to overlook something you're not looking for.

This is a site I built for my work.(RSD)
http://esmansgreenhouse.com
This is a site I built for use in my job.(HTML Editor)
https://pestlogbook.com
This is my personal site used for testing and as an easy way to share photos.(RLM imported to RSD)
https://ericrohloff.com
User 2396634 Photo


Registered User
12 posts

I actually think that it is now for some reason recognizing as being secure when it wouldn't for a very long time. I really want to try and figure out the submitting of user ID with the form though. Won't give up.

Thanks.
User 187934 Photo


Senior Advisor
20,193 posts
Online Now

You probably could use some Ajax and php script to get a variable from the form based on the element of your choice but it's going to require you to alter the form code which sucks during the first round of testing but testing a simple form makes it easy to implement on your final form.:)
I can't hear what I'm looking at.
It's easy to overlook something you're not looking for.

This is a site I built for my work.(RSD)
http://esmansgreenhouse.com
This is a site I built for use in my job.(HTML Editor)
https://pestlogbook.com
This is my personal site used for testing and as an easy way to share photos.(RLM imported to RSD)
https://ericrohloff.com

Have something to add? We’d love to hear it!
You must have an account to participate. Please Sign In Here, then join the conversation.