dcyuri7 Posted April 10, 2006 Share Posted April 10, 2006 Here's my problem:I need to go from href links, to php handled functions.There has to be a way to do this.Of course I can use ?<var>=<data> in the url, but what if I just want to execute a function when the user clicks on an href?Ill be more specific to my problem... I am using switch statements to handle which page to include, by storing the next location to goto using SESSION variables. I want the user to be able to click on a link(HTML HREF) and for it to set the SESSION variable to the next location accordingly.Any help is greatly appreciated. Quote Link to comment https://forums.phpfreaks.com/topic/6988-solved-functions-embeded-into-href/ Share on other sites More sharing options...
wildteen88 Posted April 10, 2006 Share Posted April 10, 2006 PHP is processed by the server and so a request must be made to the server for the PHP to be processed. You cannot run a PHP function as soon as you click a link, like you can do with Javascript. However you can do this with the aid of AJAX.Head over to AJAXFreaks.com for more info on AJAX or by going through the [a href=\"http://www.ajaxfreaks.com/tutorials/1/0.php\" target=\"_blank\"]AJAX Introduction tutorial[/a].That is the only way to do what you want to do. Quote Link to comment https://forums.phpfreaks.com/topic/6988-solved-functions-embeded-into-href/#findComment-25449 Share on other sites More sharing options...
dcyuri7 Posted April 10, 2006 Author Share Posted April 10, 2006 Thank you for your help!! whoo!! Quote Link to comment https://forums.phpfreaks.com/topic/6988-solved-functions-embeded-into-href/#findComment-25651 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.