Hey all!
I've been working on a website but have been having a bit of trouble with dynamic linking using php. I've tried (and failed) with different methods to get it working but i need the help of some very talented coders :)
I currently have a webpage which extracts info from a database using mysql, and i would like to link the outputted info to another page which dynamically changes content based on the link. (Each link has different information associated with it)
To simplify, lets say i have 2 pages - stuff.php and info.php
In the stuff.php file, i have managed to get the connection and output from the database all working. I have attempted to send the output name to info.php via this code.
echo "<td><a href=\"info.php?{$row['Name']}\">$f1</a></td>";
**$f1 is the variable i have used to output from the database.
On the info.php page - (This code is just to grab the name from stuff.php, and output the name)
$stuffname=$_GET["Name"];
$query="SELECT * FROM tblStuff WHERE Name='$stuffname'";
$result=mysql_query($query);
$row = mysql_fetch_assoc($result);
echo $row['Name'];
The idea is straightforward,
- User clicks link,
- Link sends user to info.php,
- stuff.php sends link name to info.php,
- info.php grabs name from stuff.php
- Outputs name
Now upon testing, the links on stuff.php appears to have the name added onto the end of each hyperlink (which is what i wanted), except that info.php isn't outputting the name of the link. Anyone able to provide any solutions?
Thanks in advance