Hello and welcome to our community! Is this your first visit?
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New to the CF scene
    Join Date
    Sep 2013
    Thanked 0 Times in 0 Posts

    Php (Header) (session?) Something which knows you are 'logged in' Or clicked a btn

    I have a site which looks like this


    on index id like to add a button saying 'dist' when pressing dist
    id like you to come to the overview page, but since you pressed 'dist' id like the php to know that and add something like '?dist' after each url. So if one clicked dist it would result in '/overview/?dist' '/item/?dist' if you didnt click dist it would just be /overview/ or /item/.

    There's no need for a password, anyone can click 'dist'

    this is because id like to alter the html with jQuery
    if (window.location.href.indexOf("?dist") != -1) { }

  2. #2
    God Emperor Fou-Lu's Avatar
    Join Date
    Sep 2002
    Saskatoon, Saskatchewan
    Thanked 2,662 Times in 2,631 Posts
    I don't see a reason for PHP here at all. The button can be used either with the JS to give it the querystring, or it can be used in a GET form to provide the dist value.
    PHP Code:
    header('HTTP/1.1 420 Enhance Your Calm'); 
    Been gone for a few months, and haven't programmed in that long of a time. Meh, I'll wing it ;)


Posting Permissions

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