hey guys,
How to insert a function into a hyperlink ?. Such as, i want to insert
a "setcookie" function in the hyperlink code like below
<a href="newpage.php?name=<?php echo urlencode($hello);?>">
<?php
$hour = time() + 3600;
echo '<p>' .$list['name']. '</p>';
setcookie(getname, list['name'], $hour);
?></a>
so that i could recall the cookie in the newpage.php once the user click the hyperlink, but i dont know to put ONCLICK function in the middle of the hyperlink code....please help me...
thanks guys!
Azhan
ONLCLICK hyperlink : how to??
Moderator: General Moderators
- jaoudestudios
- DevNet Resident
- Posts: 1483
- Joined: Wed Jun 18, 2008 8:32 am
- Location: Surrey
Re: ONLCLICK hyperlink : how to??
why do you have a <p> tag in the middle of <a> tag?
Re: ONLCLICK hyperlink : how to??
Also, make sure you understand the difference between PHP (server side) and Javascript (clientside, onclick)