SitePoint Sponsor

User Tag List

Results 1 to 5 of 5
  1. #1
    GRAPHIC DESIGNER visualkreations's Avatar
    Join Date
    Sep 2005
    Posts
    171
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    How can i do this , very simple

    I a few pages for products ,
    in each product page there is a contact button ,
    you click on it and it takes you to a contact page.

    In the contact page there are a few fields (name , email , interested in , message)


    I need it so when i click on the contact button from the products page the Interested in field is automatically typed in what product it came from.


    Thanks.

  2. #2
    Programming Team silver trophybronze trophy
    Mittineague's Avatar
    Join Date
    Jul 2005
    Location
    West Springfield, Massachusetts
    Posts
    17,227
    Mentioned
    194 Post(s)
    Tagged
    2 Thread(s)

    referring page

    You could use referer, but that can't be relied on 100% of the time. Maybe a GET var?

  3. #3
    SitePoint Addict
    Join Date
    Dec 2005
    Posts
    276
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    A GET (ie, in the url) variable sounds like the best way. This should be done server side, not with javascript.
    "Never imagine yourself not to be otherwise than what
    it might appear to others that what you were or might
    have been was not otherwise than what you had been
    would have appeared to them to be otherwise."

  4. #4
    Programming Team silver trophybronze trophy
    Mittineague's Avatar
    Join Date
    Jul 2005
    Location
    West Springfield, Massachusetts
    Posts
    17,227
    Mentioned
    194 Post(s)
    Tagged
    2 Thread(s)

    get var

    IMHO if the GET var is only going to be used to fill in a form input js would be OK. Even if someone crafted an "attack" eg. ...contact_page.html?referrer_page=htpasswd
    it wouldn't cause any security issues, just a misleading form input value. Of course this could lead to the development of a bad habit of not taking security concerns seriously, but if you and anyone that uses this code knows and is aware of possible consequences I think in this use it should be OK.

  5. #5
    GRAPHIC DESIGNER visualkreations's Avatar
    Join Date
    Sep 2005
    Posts
    171
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks for the help guys ,


    unfortuantly im not a developer so i cant write this code myself , is there some place i can download this script from?



    Thanks


Bookmarks

Posting Permissions

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