Re: functions and <a href>

From: Date: Mon, 03 Mar 2003 22:50:53 +0000
Subject: Re: functions and <a href>
References: 1 2  Groups: php.general 
Request: Send a blank email to php-general+get-137980@lists.php.net to get a copy of this message
You can't call a PHP function directly from an HTML tag. You'll instead need to do something like this: <a href='/logout.php'> Then create a logout.php file that has your logout code. > From: d99majo@swipnet.se (Martin Johansson) > Newsgroups: php.general > Date: Mon, 3 Mar 2003 23:32:16 +0100 > To: php-general@lists.php.net > Subject: Re: functions and <a href> > > Ok to make it simplier, this is what I wanna do! > > <?php > > echo "<a href=logout();>Logout</A>"; > > function logout() > { > ..... > } > > ?> > > How do I do it!!! > > /M > >> Hi >> I want to call a function logout() inside an <a href> statement: >> >> <a href=\"<?= logout() ?>\">logout</a> >> >> <?php >> function logout() >> { >> .... >> } >> ?> >> >> but this doesnt work.. how shall I do it >> /M >> >> > >

« previous php.general (#137980) next »