Results 1 to 3 of 3

Thread: Can you hide script data?

  1. #1

    Thread Starter
    New Member
    Join Date
    Sep 2007
    Posts
    2

    Can you hide script data?

    Hi there

    Heres my problem:

    I have a web form that I want to track with this script

    <script>

    document.write(document.referrer)

    </script>

    I want to hide this referring web page URL info from the user so they dont see it on the form itself

    Is this possible?

  2. #2

    Thread Starter
    New Member
    Join Date
    Sep 2007
    Posts
    2

    Re: Can you hide script data?

    Maybe I can even change that script data to a different color (same as my background) so its not visible.

  3. #3
    VB6, XHTML & CSS hobbyist Merri's Avatar
    Join Date
    Oct 2002
    Location
    Finland
    Posts
    6,654

    Re: Can you hide script data?

    You can do that also on the server side when you're serving the page to the user. Afaik the server should also get the information of the referrer. What this means is that you can write

    <input type="hidden" name="referer" value="<?php echo htmlspecialchars($_SERVER['HTTP_REFERER']); ?>" />

    to have the information sent with the form. Of course, if you don't have PHP, you'll have to find a way to do this using the server side language that you are using.

    Note that this is also much more reliable than using JavaScript, because JS can always be turned off even if it is being supported, and some corporate firewall systems may block JS. However, they may also block the referer information by stripping it out, but this solution is probably "the best you can get".

Posting Permissions

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



Click Here to Expand Forum to Full Width