SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Enthusiast
    Join Date
    Jul 2000
    Posts
    37
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Is it possible to write an href link to a php function?
    IE, <a href="function()">click here dood</a>
    or something like that? that would be pretty handy...but i'm thinking it also may not be possible, because by the time the page is served to the user the php (functions and all?) has been parsed...hmm.
    Thanks in advance, yet again, folks.

  2. #2
    SitePoint Wizard silver trophy Karl's Avatar
    Join Date
    Jul 1999
    Location
    Derbyshire, UK
    Posts
    4,411
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You are correct in thinking that since the PHP has been parsed that the browser knows nothing of the PHP so you can't link to a PHP function, what you can do though is create a link to a page that executes the function.
    Karl Austin :: Profile :: KDA Web Services Ltd.
    Business Web Hosting :: Managed Dedicated Hosting
    Call 0800 542 9764 today and ask how we can help your business grow.

  3. #3
    SitePoint Wizard TWTCommish's Avatar
    Join Date
    Aug 1999
    Location
    Pittsburgh, PA, USA
    Posts
    3,910
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Or the same page!

    <?php
    if ($action == "function") { function () {} }
    else { echo("<a href=\"$PHP_SELF?action=function\">"); }
    ?>


    I usually keep things in the same file if possible.

    Good luck!


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
  •