Trying to use a template to output from a database. Need help.
Posted 24 September 2006 - 06:29 AM
Okay, here is what I am trying to accomplish. I have a template page made and I want to be able to pull from a MySQL database to output the page into the template. I've accomplished this already.
<a href="game.php" onclick="<?php $name="example 1"; $_SESSION['name']=$name; ?>">Example 1</a>
<a href="game.php" onclick="<?php $name="example 2"; $_SESSION['name']=$name; ?>">Example 2</a>
I guess JS is client side and PHP is server side so I'm going about this all wrong. Can someone point me in the right direction?
Thanks in advance.
Posted 24 September 2006 - 05:31 PM
I would like to somehow define the $_SESSION variable as the item I would like to pull from the database. The problem I am having is I am using the same variable name and it always finds the 2nd one as it is the last one defined. I guess I am trying to figure out how I can use the same variable name, but only define it as what I am looking for if it is selected. Something along those lines.
Or, is there some other way I can pass the variable to the next page when the link is clicked or possibly pass the variable name in the link?
Posted 25 September 2006 - 01:22 AM
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users