Retrieving a URL via a Wufoo Form - wordpress

I'm pretty new to using wufoo forms and have been searching for a few days and can't quite find what I'm looking for.
I did find a number of articles about 'URL Modification' but not sure how to implement this for what I need.
We have a simple single wufoo form which is being used across 6 iterations of a client's domains (they are sector specific).
We want (in the email notification and response entry on wufoo) to record which site was used to complete the form (for analytical purposes).
In other words the email to the client should list:
Name: John Smith
Email: Johnsmith#mail.com
Phone: 555-123-1234
From: www.websiteversion1.com
The form is being integrated on Wordpress sites.
Any help would be appreciated!

You can copy the form HTML to your site's templates and modify the form, using PHP to fill in the value of the site url. I don't think WuFoo will automatically fill that field in for you.
First of all, in your WuFoo account forms manager, add a website (url) field and make it visible for admins only (this is a Wufoo option).
Then copy the generated form into your own template.
Now modify your form template so that it grabs the site URL and fills it in for the value of the website field where you want it.
Your form template might look something like this:
<form class="wufoo-form" id="form3" name="form3" accept-charset="UTF-8" autocomplete="off" enctype="multipart/form-data" method="post" novalidate action="#">
<div class="form-group">
<label for="Field1">Name</label>
<input id="Field1" name="Field1" type="text" placeholder="" value="">
</div>
<div class="form-group">
<label for="Field2">Email</label>
<input id="Field2" name="Field2" type="email" placeholder="" value="">
</div>
<div class="form-group">
<label for="Field3">Phone</label>
<input id="Field3" name="Field3" type="tel" placeholder="" value="">
</div>
<div class="form-group hidden">
<label for="Field4">From</label>
<input id="Field4" name="Field4" type="url" class="form-control" placeholder="" value="<?php esc_url( home_url() ); ?>">
</div>
<div class="form-group">
<button id="saveForm" name="saveForm" type="submit" name="submit" class="btn btn-primary btn-lg">Let's talk!</button>
<input type="hidden" id="idstamp" name="idstamp" value="***the_id_for_your_form_wufoo***" />
</div>
</form>

Related

What is the purpose of setting a hidden type of input tag? [duplicate]

This question already has answers here:
What's the point of having hidden input in HTML? What are common uses for this?
(12 answers)
Closed 5 years ago.
Full code:
<form accept-charset="UTF-8" action="/" method="get">
<div style="margin:0;padding:0;display:inline">
<input name="utf8" type="hidden" value="✓" />
</div>
<label for="first">First name:</label>
<input id="first" name="first" type="text" value="Steve" /><br/>
<label for="last">Last name:</label>
<input id="last" name="last" type="text" value="Jobs" /><br/>
<input name="commit" type="submit" value="Submit" />
</form>
<div style="margin:0;padding:0;display:inline">
<input name="utf8" type="hidden" value="✓" />
</div>
I'm reading the code from another people. I don't understand why he made a fake input field here. Is it for the css purpose?
Hidden fields are used programatically, to pass information about the current page to the server.
Hidden fields can also be used to pass information back to scripts. This may include security tokens, or the name of the relevant row in the database. The user does not need to see this data, but it is passed back to the server on submission so that scripts function correctly behind the scenes.

Wordpress' Newsletter plugin - Unable to register

Hello I've created a custom form in WP's Newsletter plugin and showed it on a pop-up plugin. the form shows but it seems I am unable to register for subscription. The modal closes upon submission so I cant know anything after submit. There's nothing listed on the subscribers list.
here's my custom newsletter form:
<div>
<input class="subscribe email" type="email" name="ne" size="30" required placeholder="Email">
</div>
<div>
<input class="subscribe name" type="text" name="nn" size="30" required placeholder="Full Name">
</div>
<div>
<select class="subscribe guardian" name="np1" placeholder="Guardian">
<option value="parent/guardian">Parent/Guardian</option>
<option value="corporate visitor">Corporate Visitor</option>
<option value="teacher">Teacher</option>
</select>
</div>
<div>
<input class="subscribe submit pop-up-btn" type="submit" value="KEEP ME IN THE LOOP!"/>
</div>
And I've called the shortcode:
<div class="popup-form">[newsletter_form form="1"]</div>

Is wordpress comment form safe?

I have this Wordpress form for comments, it's pretty standard:
<form action="http://sitename.com/wp-comments-post.php" target="writeIframe" method="post" id="commentform" class="comment-form">
<p class="comment-form-author">
<label for="author">Your name</label>
<input id="author" name="author" type="text" value="" size="30">
</p>
<p class="comment-form-comment">
<label for="comment">Comment</label>
<textarea id="comment" name="comment" cols="45" rows="8" aria-required="true"></textarea>
</p>
<p class="form-submit">
<input name="submit" type="submit" id="submit" class="submit" value="Send">
<input type="hidden" name="comment_post_ID" value="1" id="comment_post_ID">
<input type="hidden" name="comment_parent" id="comment_parent" value="0">
</p>
</form>
It sends the user input data to wp-comments-post.php inside of a hidden iframe. Is this safe out of the box Wordpress or shall I add code to prevent attacks trough my comment form?
Did you take a look at using wp_nonce_field().
Here's what WordPress codex says:
A nonce is a "number used once" to help protect URLs and forms from certain types of misuse.
So i'll definitely advice you to take a look at it and use it.
Go to this codex page to know more:
http://codex.wordpress.org/WordPress_Nonces#Adding_a_nonce_to_a_form
Do read the Adding a nonce to a form section

Contact Forum from template not working

I have downloaded this fantastic web template called Brushed. It is heavy on css, which I am not too familiar with. I have managed to complete my personal webpage through trial and error, however, I am unable to get the CONTACT FORM to work through my servers.
The code from the template.
<!-- Contact Form -->
<div class="row">
<div class="span9">
<form id="contact-form" class="contact-form" action="#">
<p class="contact-name">
<input id="contact_name" type="text" placeholder="Full Name" value="" name="name" />
</p>
<p class="contact-email">
<input id="contact_email" type="text" placeholder="Email Address" value="" name="email" />
</p>
<p class="contact-message">
<textarea id="contact_message" placeholder="Your Message" name="message" rows="15" cols="40"></textarea>
</p>
<p class="contact-submit">
<a id="contact-submit" class="submit" href="mailto:info#elementsglobal.in">Submit</a>
</p>
<div id="response">
</div>
</form>
Any help would be greatly appreciated.
Thank you.
You need to create a resource (e.g. uri) that you can post your form to on your server. That is, you need to change the following
<form id="contact-form" class="contact-form" action="#">
to something like this
<form id="contact-form" class="contact-form" action="/contact/create">
And, you need to add a resource at "/contact/create" in your server that would parse form variables that are passed in from the post request, and do your thing (either save it to the database table or send yourself an email.
I hope this makes sense.
The contact form wont work because you have the action set to # and you dont have a method of sending the data. So unless you are grabbing this data another way that you dont have posted you should start by fixing these
<form id="contact-form" class="contact-form" action="#"/*Fix this*/ method="post">

How to implement a search feature for WordPress CMS?

I need to incorporate a "Search" feature within my WordPress CMS site that I am currently developing and was hoping to attach this feature/plugin to the following piece of code and unsure how to do this in WordPress, i.e.:
<div id="search_box">
<form method="get" action="/search" id="form">
<input name="white_box" type="text" class="search" value="Search site" size="19" maxlength="80" id="white_box" onfocus="if (this.value=='Search site') this.value = ''"/>
<input name="submit" type="image" class="submit" value="submit" src="images/search_btn.jpg" />
</form>
</div>
I basically want to incorporate a "Search" feature on my site.
#Tonsils you may use any of below ready-to-use WordPress plugins depends on your requirement...
Use Relevanssi Plugin for Multilingual Support
http://wordpress.org/extend/plugins/relevanssi/
Use WPSearch for well behave custom Search
http://wordpress.org/extend/plugins/wpsearch/
Use Search-Everything for all type of Content Search
http://wordpress.org/extend/plugins/search-everything/
This a very basic WordPress search form. See the difference in the form action URL?
<form method="get" id="searchform" action="<?php bloginfo('home'); ?>/">
<input type="text" size="14" value="<?php echo wp_specialchars($s, 1); ?>" name="s" id="s" class="s" />
<input type="submit" id="searchsubmit" value="<?php _e('GO'); ?>" />
</form>

Resources