• Hi! I’m doing a site for a real estate office. I was wondering if I can do the following:
    -When the user is looking at a property (entry), they can click “contact us” and it would lead them to the contact page with the message already written: “I’m interested in this propery: [ID numer]”.

    Is it possible?
    Thanks in advance!!

Viewing 3 replies - 1 through 3 (of 3 total)
  • It is possible. You can pass values either through the URL or as hidden form values, depending on how the link to ‘Contact Us’ is set up.

    If it’s using a form, them this will be what you’re after:

    <form action="contactus" method="post">
        // From code goes in here
        <input type="hidden" name="propertyid" value="PROPERTYID" />
    </form>

    If it’s a standard link, then set up the link link this?

    <a href="https://www.site.com/contactus/propertyid=PROPERTYID">Contact Us</a>

    Of course, you’d need to substitute the actual ID for the areas that I have PROPERTYID in there.

    Thread Starter EstMiu

    (@estmiu)

    Hi! Thank you for your response! The problem is that way I’d have to put a different link for every entry, and the idea is that the client uploads the properties.
    Is there another way?

    No. If you want each property to be sent thorugh with it’s own details you need to have the property ID in there somewhere no matter which way you do it. How else would the system know which property this relates to?

    And the property ID can be found through a small bit of code, so you don’t need to hard-code anything at all. Depending on how you’ve got this set up it could be as easy as:

    <a href="https://www.site.com/contactus/propertyid=<?php echo $post->ID; ?>">Contact Us</a>

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Sending an ID number through contact form’ is closed to new replies.