dcsimg
www.webdeveloper.com
Results 1 to 3 of 3

Thread: When clicking a link, it goes to that link ,plus making a variable equal to something

  1. #1
    Join Date
    Apr 2017
    Posts
    8

    When clicking a link, it goes to that link ,plus making a variable equal to something

    I have 2 pages(page-1 and page-2) that have the same link to go this one page (lets say page-3). There are two ways to page-3 because those 2 pages carry different variable. Page-1 brings $num = 1, and page-2 brings $num = 2. Then, page-3 will use those values to do certain things. How to bring those values exactly? because Url is just an address, and theres no way to bring any value in it.

    there's a picture if you don't see my situation. tq

    Attachment 17517

  2. #2
    Join Date
    Dec 2012
    Posts
    1,587
    because Url is just an address, and theres no way to bring any value in it.
    That's not true:
    https://en.wikipedia.org/wiki/Query_string

  3. #3
    Join Date
    Aug 2004
    Location
    Ankh-Morpork
    Posts
    22,237
    You can use "example.com/somepage?page=1", and page will be available however the programming language/framework you use stores GET key/value pairs. For example, in PHP, $_GET['page'] would equal 1 in this case.

    There are techniques that can make "prettier" URLs, such that it might look like "example.com/somepage/1", and the web server and/or application settings would be used to send that to the "sompage" script with the page value of 1.
    "Well done....Consciousness to sarcasm in five seconds!" ~ Terry Pratchett, Night Watch

    How to Ask Questions the Smart Way (not affiliated with this site, but well worth reading)

    My Blog
    cwrBlog: simple, no-database PHP blogging framework

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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