I have a few xml documents that are different events. In my mySQL database I'm storing the name (name in database) and a link (xml in database) to the corresponding xml document. i.e.
Event 1 --- event1.xml
Event 2 --- event2.xml
etc.
I'm using PHP to get the content from the database and display it in html. When I get the name of the event it displays correctly.
CODE
<?php
while($row = mysql_fetch_array($result))
{
echo "<a href = 'main.php'> <div style = 'font-size:16pt'>" . $row['name'] . "</div> </a>";
}
setcookie("xmlDoc", $row['xml']);
?>
while($row = mysql_fetch_array($result))
{
echo "<a href = 'main.php'> <div style = 'font-size:16pt'>" . $row['name'] . "</div> </a>";
}
setcookie("xmlDoc", $row['xml']);
?>
I'm trying to store $row['xml'] in a cookie so that I can access the xml's content in main.php.
What I want to do is when the user clicks on an event, that event's xml document must display in main.php. At the moment event1.xml's content is displaying when I click on Event 1 and Event 2.
What can I use (maybe onClick or something?) to store the xml document corresponding to the right $row['name'] in $row['xml']?
Thanks
