Solved

PHP Hyperlink

Posted on 2004-03-31
3
3,173 Views
Last Modified: 2012-06-27
Is there any possible way for me to call a php function with a hyperlink or something similar too it?
Thanks
0
Comment
Question by:Zeman4323
3 Comments
 
LVL 6

Expert Comment

by:CosminB
Comment Utility
if you mean like when a user clicks a link or button from your page the answer is no

you can do something like this:
<a href="myscript.php?function=myfunction">Click me</a>
and in your php add
<?php
if ($_GET['function'] == 'myfunction')
{
  myfunction();
}
?>
0
 
LVL 2

Accepted Solution

by:
aabbas earned 125 total points
Comment Utility
Below is the answer... enter url: http://domain/f.php?f=abc ........ and you will see. :)


<?php
// f.php
  function abc () {
    echo "ABC";
  }

  function xyz () {
    echo "XYZ";
  }

  $v = $_REQUEST["f"];

  $v();
?>

Best of luck.
0
 

Author Comment

by:Zeman4323
Comment Utility
ok, thanks, didnt think an actual hyperlink was possible, but your way will work perfectly, thanks
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Introduction HTML checkboxes provide the perfect way for a web developer to receive client input when the client's options might be none, one or many.  But the PHP code for processing the checkboxes can be confusing at first.  What if a checkbox is…
These days socially coordinated efforts have turned into a critical requirement for enterprises.
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

5 Experts available now in Live!

Get 1:1 Help Now