Using strings in a URL
Posted: Tue May 13, 2008 3:43 am
Haylp!
I am designing a family tree website. I have produced a database which currently contains one of my ancestors (for test purposes). Each ancestor has a Unique Reference Number (URN).
http://www.didymus.org.uk/display.php
This works fine because the URN of my ancestor is specified in the body of the PHP by using the line:
$urn = "583";
So when you access the above page, the row with URN 583 is called from the MySQL database and displayed.
What I WANT to be able to do is to make this variable and call data from the MySQL DB dependent on the hyperlink clicked by the user
i.e. http://www.didymus.org.uk/display.php?urn=583
But whatever I do I cannot get it to work. I've tried changing the PHP code to:
$urn = "hlurn"
and using the URL http://www.didymus.org.uk/display.php?hlurn=583
But when I try, the page is blank.
What do I need to do to get this function to work?
Many, MANY thanks for saving what little hair I have left!
Kris Didymus.
I am designing a family tree website. I have produced a database which currently contains one of my ancestors (for test purposes). Each ancestor has a Unique Reference Number (URN).
http://www.didymus.org.uk/display.php
This works fine because the URN of my ancestor is specified in the body of the PHP by using the line:
$urn = "583";
So when you access the above page, the row with URN 583 is called from the MySQL database and displayed.
What I WANT to be able to do is to make this variable and call data from the MySQL DB dependent on the hyperlink clicked by the user
i.e. http://www.didymus.org.uk/display.php?urn=583
But whatever I do I cannot get it to work. I've tried changing the PHP code to:
$urn = "hlurn"
and using the URL http://www.didymus.org.uk/display.php?hlurn=583
But when I try, the page is blank.
What do I need to do to get this function to work?
Many, MANY thanks for saving what little hair I have left!
Kris Didymus.