473,385 Members | 1,329 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Passing value with Hyperlink click !!!

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.
Dec 26 '07 #1
3 5521
Markus
6,050 Expert 4TB
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

:)
Dec 26 '07 #2
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

:)
thnx mate but unfortunatly i think i was unable to explain my problem. I am not posting any form. It will be just a list of players hyperlinks. if a user clicks on a hyperlink of any players name the page should redirect to detailed profile of that player. that detailed profile is saved in database. How can i instruct database which profile it should show?
Dec 26 '07 #3
Markus
6,050 Expert 4TB
thnx mate but unfortunatly i think i was unable to explain my problem. I am not posting any form. It will be just a list of players hyperlinks. if a user clicks on a hyperlink of any players name the page should redirect to detailed profile of that player. that detailed profile is saved in database. How can i instruct database which profile it should show?
Do exactly what i said...

add the usersname into a url : yoursite.com/user/?user=username

when the user clicks the url they'll be taken to : yoursite.com/user/?user=username

on the yoursite.com/user/index.php page

do this

[php]
$user = $_GET['user'];
[/php]
then do anything you have to using the variable $user...
Dec 26 '07 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: aa | last post by:
I have a section of a website which is heavily loaded with technical terminoogy. I have a Glossary database running from ASP code which accepts a string and returnd it's meaning (is there is...
7
by: Randell D. | last post by:
Folks, I am working on a contact db using PHP and MySQL. My results so far outputs a slimed down version of records to the browser. I would like to implement a method whereby the user can...
4
by: hansen | last post by:
hi all, I am creating online quiz (10 questions) with radio buttions (Yes/No). When the user clicks on the submit button i do some calculation and based on that calculation i display result.aspx...
2
by: Gordon Hudson | last post by:
Hello Here is what I am trying to do: Make a hyperlink on a data entry form with its URL built from the values for fields in that entry on the database. So, I would go to record 65785 click...
1
by: Pat | last post by:
All, What I want to do: ******************* Click on a hyperlink in the last column in a datagrid, have it grab a value in the fourth column in the same row and send it to the codehind into a...
4
by: wrytat | last post by:
I have a form with a textbox for the user to enter a quantity and another textbox for the delivery date. I disabled this delivery date textbox such that the user has to press a calendar link next...
1
by: abertay | last post by:
Hi friends...I need our help.I'm stuck with this code... can some one tell me how can pass a javascript variable into hyperlink along with a php varaible? Here is my code.. <html> <head>...
4
by: abhishekbrave | last post by:
Hi Can we pass a value through hyperlink. My requirement is that suppose i have 3 hyperlinks 1 2 3 When I click on 1 or 2 or 3 another HTML page will get open having the information that "1 is...
1
by: Wolfman | last post by:
Hi gang! I've been searching for a solution to this problem extensively but nothing really hits the mark. I have a descriptive popup page that contains a PayPal order button. The normal PayPal...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.