Title: [Plugin: Fast Secure Contact Form] echo php variable in hidden field
Last modified: August 19, 2016

---

# [Plugin: Fast Secure Contact Form] echo php variable in hidden field

 *  [ombre8](https://wordpress.org/support/users/ombre8/)
 * (@ombre8)
 * [15 years, 4 months ago](https://wordpress.org/support/topic/plugin-fast-secure-contact-form-echo-php-variable-in-hidden-field/)
 * Hi there,
 * I would like to include a Code into a hidden field so that it get send to the
   admin and is saved in the DB (using Contact Form to DB Extension). But i can’t
   figure out how to include a variable into the hiddenfield…
 * `Code,<?php echo $the_code; ?>` isn’t working… is there a easy way to do something
   like that? I don’t care if I have to change something in the source, to make 
   it work…
 * greets
 * [http://wordpress.org/extend/plugins/si-contact-form/](http://wordpress.org/extend/plugins/si-contact-form/)

Viewing 11 replies - 1 through 11 (of 11 total)

 *  [Mike Challis](https://wordpress.org/support/users/mikechallis/)
 * (@mikechallis)
 * [15 years, 4 months ago](https://wordpress.org/support/topic/plugin-fast-secure-contact-form-echo-php-variable-in-hidden-field/#post-1906551)
 * Tell me more about why you need that, then maybe I can suggest something.
 * Mike
 *  Thread Starter [ombre8](https://wordpress.org/support/users/ombre8/)
 * (@ombre8)
 * [15 years, 4 months ago](https://wordpress.org/support/topic/plugin-fast-secure-contact-form-echo-php-variable-in-hidden-field/#post-1906557)
 * I would like to use the plugin as an order form for tickets for a festival. The
   Code is needed to identify the buyer. the simpelst way to get it into the DB 
   and the Mail is by using a hidden field (i think), in which i enter the variable…
 * thanks for your help!
 *  [Mike Challis](https://wordpress.org/support/users/mikechallis/)
 * (@mikechallis)
 * [15 years, 4 months ago](https://wordpress.org/support/topic/plugin-fast-secure-contact-form-echo-php-variable-in-hidden-field/#post-1906578)
 * You can do this if it meets your needs:
 * Add a extra hidden field to the form, then use the query string URL feature to
   set it dynamically.
 * ht tp://www.yoursite.com/test_form?1ex_field1=2222
 * [form number]ex_field[field number]=[string]
    Example: form 1 using extra field
   1 for hidden field: &1ex_field1=2222
 * I just had to add hidden to be allowed on the query, so if you want to use it,
   you have to upgrade first:
    [http://www.fastsecurecontactform.com/update-to-the-latest](http://www.fastsecurecontactform.com/update-to-the-latest)
 * Can you use this?
 *  Thread Starter [ombre8](https://wordpress.org/support/users/ombre8/)
 * (@ombre8)
 * [15 years, 4 months ago](https://wordpress.org/support/topic/plugin-fast-secure-contact-form-echo-php-variable-in-hidden-field/#post-1906673)
 * Hi Mike,
 * thanks for your Help, I don’t really get it at the Moment, how do i get this 
   string to get dynamically?
 * Thank you very much
 * lukas
 *  [Mike Challis](https://wordpress.org/support/users/mikechallis/)
 * (@mikechallis)
 * [15 years, 4 months ago](https://wordpress.org/support/topic/plugin-fast-secure-contact-form-echo-php-variable-in-hidden-field/#post-1906674)
 * Tell me more about your “Code needed to identify the buyer”.
    Where does that
   come from?
 * Mike
 *  Thread Starter [ombre8](https://wordpress.org/support/users/ombre8/)
 * (@ombre8)
 * [15 years, 3 months ago](https://wordpress.org/support/topic/plugin-fast-secure-contact-form-echo-php-variable-in-hidden-field/#post-1906677)
 * thats a rand() number + the time stamp, the buyer tells us the number (he will
   get when he order) when he pays and so that we know what he orderd… (it doesn’t
   work over names or something because of our great bank system)
 *  [zorbs](https://wordpress.org/support/users/zorbs/)
 * (@zorbs)
 * [15 years, 2 months ago](https://wordpress.org/support/topic/plugin-fast-secure-contact-form-echo-php-variable-in-hidden-field/#post-1906759)
 * Same request as per ombre8 here.
 * This is used as a front-end to a payment order form. My system needs to generate
   order numbers automatically.
 * I have a function that generates (algorithmically) an order number using Unix
   timestamp as a seed. I need to pass this value to a 3rd party URL, through your“
   Query string key value pairs to add:”:
 * order_no={PHP HERE}
 * It would be nice if this would be compatible with “Shortcode Exec PHP” plugin,
   which allows me to easily define my PHP function and then call it from anywhere
   with a custom-defined shortcode. I would then be able to create my order-generation
   as a shortcode (say “make_orderNo”], and call it from your field “Query string
   key value pairs to add:”:
 * order_no=[make_orderNo]
 * Another idea, which is self-sustained, and wouldn’t make your plug in depended
   on anything else, you could program a new field type, i.e. “Dynamic”, and you
   allow form developers to choose from a list of constructors, which would generate
   dynamic data on-the-fly. For example, “the right X digits from a timestamp”, 
   or “a random number with X digits, ranged from Y to Z”, plus configurable header
   or trailer.
 * I would then have a hidden, dynamic field, which I would then rename and pass
   along to the 3rd party url.
 * Under a worst-case scenario, where in your php code should I insert a conditional
   statement, looking for something unique on that form (i.e. the form number), 
   and then define my dynamic field manually?
 * Thank you for your great plugin!
 *  [zorbs](https://wordpress.org/support/users/zorbs/)
 * (@zorbs)
 * [15 years, 2 months ago](https://wordpress.org/support/topic/plugin-fast-secure-contact-form-echo-php-variable-in-hidden-field/#post-1906760)
 * Notwithstanding – of course – the already-available option of submitting the 
   form to an intermediary PHP script, which adds the dynamically-generated new 
   field, prior to sending to the final destination…
 *  [Mike Challis](https://wordpress.org/support/users/mikechallis/)
 * (@mikechallis)
 * [15 years, 2 months ago](https://wordpress.org/support/topic/plugin-fast-secure-contact-form-echo-php-variable-in-hidden-field/#post-1906761)
 * zorbs,
 * Currently there is no random or incremental field option. I have it on a to do
   list for future updates.
    Maybe you could set a optional hidden field with shortcode
   and put your php generated order # in there? [http://www.fastsecurecontactform.com/shortcode-options](http://www.fastsecurecontactform.com/shortcode-options)
 * Mike
 *  [zorbs](https://wordpress.org/support/users/zorbs/)
 * (@zorbs)
 * [15 years, 2 months ago](https://wordpress.org/support/topic/plugin-fast-secure-contact-form-echo-php-variable-in-hidden-field/#post-1906762)
 * Hmm, haven’t tested this, but it may work:
    [si-contact-form form=’1′ hidden=’
   account=[PHP shortcode here]’]
 * I have solved my issue by posting to another page, then adding my auto code then
   sending further to the final destination.
 * Thanks,
 *  [Jup1898](https://wordpress.org/support/users/jup1898/)
 * (@jup1898)
 * [14 years, 7 months ago](https://wordpress.org/support/topic/plugin-fast-secure-contact-form-echo-php-variable-in-hidden-field/#post-1906830)
 * This thread seems to be related to what I’d like to do with one of my sites. 
   I am passing the keyword from Google AdWords through to the landing page URL 
   and the landing page has additional PHP code to get the kw from the URL and store
   it as a PHP variable called ‘$kw’
 * I’d like to insert ‘$kw’ as the default value of a hidden field. What do I need
   to type in the default text box in my form? (sorry if I’m doing this posting 
   wrong – this is my first comment/question ever 🙁 )

Viewing 11 replies - 1 through 11 (of 11 total)

The topic ‘[Plugin: Fast Secure Contact Form] echo php variable in hidden field’
is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/si-contact-form_dde2be.svg)
 * [Fast Secure Contact Form](https://wordpress.org/plugins/si-contact-form/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/si-contact-form/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/si-contact-form/)
 * [Active Topics](https://wordpress.org/support/plugin/si-contact-form/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/si-contact-form/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/si-contact-form/reviews/)

 * 11 replies
 * 4 participants
 * Last reply from: [Jup1898](https://wordpress.org/support/users/jup1898/)
 * Last activity: [14 years, 7 months ago](https://wordpress.org/support/topic/plugin-fast-secure-contact-form-echo-php-variable-in-hidden-field/#post-1906830)
 * Status: not resolved