accessing link attributes..

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
ps_sach
Forum Newbie
Posts: 3
Joined: Thu Mar 13, 2008 11:40 pm

accessing link attributes..

Post by ps_sach »

consider following html code :
<html>
<body>
<p>
<a href="topic.php"&username value="sachin">
</a>
</body>
</html>
</p>


how do i access this $username variable in topic.php
Last edited by ps_sach on Fri Mar 14, 2008 12:45 am, edited 1 time in total.
User avatar
Christopher
Site Administrator
Posts: 13596
Joined: Wed Aug 25, 2004 7:54 pm
Location: New York, NY, US

Re: accessing link attributes..

Post by Christopher »

Code: Select all

<html>
<body>
<p>
<a href="topic.php?username=sachin">Topic</a>
</p>
</body>
</html>
topic.php

Code: Select all

<?php
echo "username=" . $_GET['username'];
http://www.php.net/manual/en/language.v ... efined.php
(#10850)
ps_sach
Forum Newbie
Posts: 3
Joined: Thu Mar 13, 2008 11:40 pm

Re: accessing link attributes..

Post by ps_sach »

arborint wrote:

Code: Select all

<html>
<body>
<p>
<a href="topic.php?username=sachin">Topic</a>
</p>
</body>
</html>
topic.php

Code: Select all

<?php
echo "username=" . $_GET['username'];
http://www.php.net/manual/en/language.v ... efined.php
Thanks! I have tried it & it works....
Post Reply