how to call a function when somebody click a link?
- From: "yangsuli@xxxxxxxxx" <yangsuli@xxxxxxxxx>
- Date: 3 Nov 2006 22:58:37 -0800
i want to creat a link
when somebody click the link
the php script calls a function,then display itself :)
i have tried
<a href=<? funtion(); echo=$_server['php_self'] ?>text</a>
but it will call the function whether i click the link
then i tried this (using forms)
<form action="<?php function(); echo "<script>"; echo
"window.location.href=$_SERVER['PHP_SELF']"; echo '</script>';?>">
<input type="submit" value="text" /></form>
but it didnot work either.
my browser said there were parse errors,T_STRING expected or
something....:(
now i am thinking using a flag,say,$functioncall,
href=$_server[request_url]&functioncall=1
then if functioncall==1,call that function
but is it right?
is there some way simple to do that?
any suggestion is appreciated :)
.
- Follow-Ups:
- Re: how to call a function when somebody click a link?
- From: Mateusz Markowski
- Re: how to call a function when somebody click a link?
- Prev by Date: Re: IE won't display gif created by GD threw php.
- Next by Date: How to get visitor host name?
- Previous by thread: IE won't display gif created by GD threw php.
- Next by thread: Re: how to call a function when somebody click a link?
- Index(es):
Relevant Pages
|