For example
Code: Select all
<?php
function check(){.....}
?>
<a href=???????> Check </a>
Moderator: General Moderators
Code: Select all
<?php
function check(){.....}
?>
<a href=???????> Check </a>
Yes, i have. But what i mean is, that i need to somehow make a "trigger". When user clicks on the link, i need to call predeclared function. But i don't know how to do it. I don;t want to use onclick or something like that...WebbieDave wrote:Not sure what you mean? Have you checked out some PHP tutorials? Perhaps that may clear up some things:
http://www.google.com/search?hl=en&safe ... tnG=Search
it's supposedto logout user. But i don't want to redirect on other .php to log him out and then redirect back. I want to simply logout him without any redirection. Something like this, but i would like to find easiest way.WebbieDave wrote:And what is this predeclared function supposed to do?
Code: Select all
<?php
if($_GET['action']=="logout") { logout(); }
?>
<a href="index.php?action=logout">logout</a>
This is another example of AJAX being used for all the wrong reasons. As a user I expect to "leave" a page when I logout, it's virtually a standardized interface design pattern. There's certainly no need for an AJAX solution here.WebbieDave wrote:What about AJAX? This would log out the user behind the scenes without him leaving the page at all. It would require Javascript but there are many free libraries out there that handle the bulk of the coding.
You must know much more about the project details than I do, being so certain that it's the wrong solution. I'm not as certain (hence I posed it as a question). It seemed the OP was asking for a way to log out without leaving the page. Hence, the AJAX suggestion. Not our job to design his project.stakes wrote:This is another example of AJAX being used for all the wrong reasons
That is the easiest way.Volt2 wrote:it's supposedto logout user. But i don't want to redirect on other .php to log him out and then redirect back. I want to simply logout him without any redirection. Something like this, but i would like to find easiest way.WebbieDave wrote:And what is this predeclared function supposed to do?Code: Select all
<?php if($_GET['action']=="logout") { logout(); } ?> <a href="index.php?action=logout">logout</a>
Thank you, AJAX works quite well. Thank everyone for suggestion.WebbieDave wrote:You must know much more about the project details than I do, being so certain that it's the wrong solution. I'm not as certain (hence I posed it as a question). It seemed the OP was asking for a way to log out without leaving the page. Hence, the AJAX suggestion. Not our job to design his project.stakes wrote:This is another example of AJAX being used for all the wrong reasons