Solved

PHP Hyperlink

Posted on 2004-03-31
3
3,178 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
ID: 10724260
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
ID: 10724911
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
ID: 10725803
ok, thanks, didnt think an actual hyperlink was possible, but your way will work perfectly, thanks
0

Featured Post

Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Foreword (July, 2015) Since I first wrote this article, years ago, a great many more people have begun using the internet.  They are coming online from every part of the globe, learning, reading, shopping and spending money at an ever-increasing ra…
This article discusses four methods for overlaying images in a container on a web page
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…
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

825 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