SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Member
    Join Date
    Feb 2012
    0 Post(s)
    0 Thread(s)

    Smile html hidden fields question

    I'm an html coder and I want to identify from what website a user has submitted a contact form. The contact form is an <!--#include>file (.shtml) and this contact form <!--#include>file is being used on two different websites. Since it's only one file (<!--#include>) I thought about adding two hiddenfields to the <!--#include> contact form with IDs of the two different sites:

    <input type="hidden" data-id="new_student_signup" name="new_student_signup" value="" />
    <input type="hidden" data-id="existing_student_signup" name="existing_student_signup" value="" />

    But I'm not sure this will work since it's only one file. Here's why:

    • If its just one <!--#include>file, how is the form going to know what site it came from?
    • Does it require a programming scripting language to get information from a hidden field in html, and if so, will my adding the two hidden input fields (with the "data-id"="" attribute) be sufficient for the html part of the <!--#include> file?
    • Should I just create a new <!--#include>file for the other website and add the hiddenfield to that file?

      for the hidden field "new_student_signup" <!--#include virtual="new_students/existing_student_signup.shtml>
      for the hidden field "existing_student_signup" <!--#include virtual="existing_students/new_student_signup.shtml>


  2. #2
    Non-Member bronze trophy
    Join Date
    Nov 2009
    Keene, NH
    23 Post(s)
    0 Thread(s)
    SHTML is built SERVER SIDE--- what is sent to the client (user's browser) is flat HTML no different than if you cut/paste that file in to replace your <!--#include>

    NO difference! Ok, try this. Make a page using your SHTML include... put it on your server, load it in your browser, and hit "view source".

    Though for what you want to do with it -- I'd either switch to a real scripting language to change a hidden field using a variable or parameter to a function, or use multiple includes to build the form.

Tags for this Thread


Posting Permissions

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