WordPress.org

Ready to get started?Download WordPress

Forums

[Plugin: Contact Form 7] How to make a field auto-filled from $_GET or $_POST ? (13 posts)

  1. aatkco
    Member
    Posted 4 years ago #

    Hi WordPressers,

    I want to put a link at every post to a contact page this way :
    http://www.site.com/contactme ( Where the title of the post is sent by GET or POST Method ), then the "title of post" field on the contact page is auto-filled from the sent name .

    How can I do this ?

    Thanks

    http://wordpress.org/extend/plugins/contact-form-7/

  2. aatkco
    Member
    Posted 4 years ago #

    Any help ppl ?

  3. andanet
    Member
    Posted 4 years ago #

    Hi aatkco. A little search before posting can been help you.
    See here:
    http://wordpress.org/support/topic/313287?replies=5

    I've used this hack and it's ok.
    Bye

  4. aatkco
    Member
    Posted 4 years ago #

    Thanks @andanet
    I'm wondering how to complete the whole thing by posting a link @ every post like that :
    contact?name=(namehere)
    What is the right url to the contact form with a GET variable Where my contact page is : http://www.myblog.com/contact

    And how to replace the (namehere) with the post name every post ?

    Sorry for many questions , How you gonna help me again.
    Thanks,
    Ahmed

  5. andanet
    Member
    Posted 4 years ago #

    http://www.myblog.com/contact/?page_id=3&name=antonio

    Insert in tag
    [text name "GET_name"]

  6. aatkco
    Member
    Posted 4 years ago #

    Didn't Work
    My contact page : http://www.myblog.com/add-feedback/
    I tried To but a link to :
    http://www.myblog.com/add-feedback/?page_id=9&name=text name "GET_name"]
    But nothing changed Or you mean this "[text name "GET_name"]" Must be added to the contact form ?
    i want every post's name to be sent to the contact form .
    Thanks

  7. aatkco
    Member
    Posted 4 years ago #

    ??

  8. Takayuki Miyoshi
    Member
    Posted 4 years ago #

    I'm not sure what you need, but if you just want to know the post title which contains the contact form, you can do it with a special mail-tag [wpcf7.post_title]

    http://contactform7.com/2009/12/25/special-mail-tags/

  9. aatkco
    Member
    Posted 4 years ago #

    @takayukister I need to know the names of my blog posts so i send them as _GET queries to the contact form .

  10. aatkco
    Member
    Posted 4 years ago #

    ؟؟؟؟

  11. aatkco
    Member
    Posted 4 years ago #

    ??????

  12. autotransport
    Member
    Posted 4 years ago #

    A good solution is to use "Id" in Contact Form 7 values.

    1. Set up an html form that will pass variables

    <form action="URL_TO_CONTACT_FORM_7_PAGE" method="get">
    <select name="YOUR_VALUE" id="YOUR_VALUE">
    <option value="1">1</option>
    <option value="2">2</option>
    <option value="3">3</option>
    </select>
    </form>

    2 Set up a Contact Form 7 element with "id":

    [select YOUR_VALUE id:YOUR_VALUE
    "1"
    "2"
    "3"
    ]

    3. Use javascript on the page, and php (use exec php plugin or similar to execute php code)

    [CONTACT FORM 7 TAG]
    
    <script type="text/javascript">
     document.getElementById('YOUR_VALUE').value = "<?php echo $_GET['YOUR_VALUE'];?>";
    </script>

    See it in action here:
    http://www.crowleyautotransport.com/

  13. samisave
    Member
    Posted 3 years ago #

    I tried following autotransport...

    but

    When sending this url to my formpage:
    http://mywebsite.dk/site/?page_id=881&Annonce-overskrift=Here is the text

    instead of writing the variable in my txt field i just get the text <?php echo $_GET['Annonce-overskrift']; ?> written inside the text field.

    Anyone knows why?

Topic Closed

This topic has been closed to new replies.

About this Topic