PLEASE NOTE: These forums are no longer utilized and are provided as an archive for informational purposes only. All support issues will be handled via email using our support ticket system. For more detailed information on this change, please see this blog post.

Passing query string value to form field removes spaces

  1. This is my link:
    http://www.cleverlyinvite.com/contact?style=<?php echo get_post_meta($post->ID, 'style_description', true);?>">I like this invite! Let's meet!

    This is what I want the form to fill with:
    Two-panel, multi-layered invitation with custom slitted pocket, sheer ribbon knot

    This is what it fills with instead:
    Two-panel,%20multi-layered%20invitation%20with%20custom%20slitted%20pocket,%20sheer%20ribbon%20knot

    Is there any way to have it do spaces instead? Something I can do on the url end perhaps to tell it to leave the spaces?

    Thanks

    Posted 13 years ago on Friday May 27, 2011 | Permalink
  2. Try using:

    urlencode(get_post_meta($post->ID, 'style_description', true))

    This should URL encode the value you are passing in the query string.

    Posted 13 years ago on Friday May 27, 2011 | Permalink
  3. Carl,

    You don't know how many times Ive visited your forums and found the answer to what I'm looking for. You were spot on again. Thanks!

    Posted 13 years ago on Friday May 27, 2011 | Permalink

This topic has been resolved and has been closed to new replies.