SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Addict
    Join Date
    Feb 2006
    Posts
    247
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Setting Actions To Text Links

    Hey guys,

    I'm trying to figure out how to perform an action when a link is pressed. I know how to use the isset function with Form buttons, but I don't know how to do it with links. Is it possible?

  2. #2
    Follow Me On Twitter: @djg gold trophysilver trophybronze trophy Dan Grossman's Avatar
    Join Date
    Aug 2000
    Location
    Philadephia, PA
    Posts
    20,580
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Parameters passed in the query string of a URL are populated in the $_GET superglobal.

    Clicking this link:
    http://www.example.com/example.php?name=Dan

    Would be the equivalent of doing the following in example.php
    PHP Code:
    $_GET['name'] = "Dan"
    You could test if the name was sent in to example.php with isset again:
    PHP Code:
    if (isset($_GET['name'])) {
        echo 
    "Hello, " $_GET['name'];
    } else {
        echo 
    "Hello, guest";


  3. #3
    SitePoint Addict
    Join Date
    Feb 2006
    Posts
    247
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks. I was aware of that. However, I overlooked it. 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
  •