Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    Regular Coder
    Join Date
    Jun 2002
    Location
    USA
    Posts
    308
    Thanks
    0
    Thanked 0 Times in 0 Posts

    If coming from a specified page, then place check in checkbox

    Is this possible using php? I have a contact form that allows users to request info for four different products, each of which have a checkbox so that the user can get info on product 1 only, or products 3 and 4, you get the point..

    How is it possible to populate the checkbox for product one on the request page, for instance, if they were on the product one details page. Does this make sense?

    Here's one of the checkbox inputs if that helps:

    <input class="prodchex" type="checkbox" name="01" value="candles">

    Thanks,

    Ash

  • #2
    Regular Coder
    Join Date
    Mar 2004
    Posts
    115
    Thanks
    0
    Thanked 0 Times in 0 Posts
    <input class="prodchex" type="checkbox" name="01" value="candles" <?php
    if($_SERVER['HTTP_REFERER']=="http://www,domain.com/page.ext")
    {
    echo" checked";
    }
    ?> >

  • #3
    Regular Coder
    Join Date
    Jun 2002
    Location
    USA
    Posts
    308
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Like a charm, thanks!!


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •