hi, I want to pass a value with hyperlink click to a php page.What i want to do is I have a list of 12 players in form of hyperlinks. if some user want to check profile of any player he will click on that players hyperlink, I have information of all players in database. I want that hyperlink player name in my database query to search that players profile in database.
You'd want to use the
$_GET function.
Pass your players username (or id) through the url like so:
www.yoursite.com/some_directory/index.php?id=username_here
You'd change the bits that needed changing - the bits that are in bold ;)
On your php page, in this case it's index.php,
you'd have something like so:
[php]
<?php
$user = $_GET['id']; // GETS the string following 'id' in the url.
// execute code here
// query your db with the $user
?>
[/php]
Hope that helps :)
Also, you can pass multiple values with the url by seperating them with a
&
e.g.
www.yoursite.com/somedirectory/index.php?id=username
&something=blah
&something_else=yeh
:)