Help - Search - Members - Calendar
Full Version: Select List Issues
Zymic Webmaster Forums > Web Design & Development > Server Side Scripting > PHP
The Seventh Hokage
hi everyone!

I have a select list for my webpage, it is generated based off information in a database. my problem with that select list is using the information.

What i'd like to do is have a script run onchange that will carry over a variable's value to another page.

This select list value is the most important part of the script because without it the effect won't register correctly. All of my code works correctly so it's not a coding problem, it's simply a matter of transferring information from page to page.


explained in another way. ..

I'm creating a browser based game. Your character has a set of skills that they have learned to use aka the select list.

When you choose a skill, ajax will output the damage you cause to your enemy based on querying the database and collecting info for the skill by name.

does that make better sense?

my problem is that i can't carry over the information i need. If I could implement post or get superglobals from the select list i would be able to but im not sure how. I'm also not sure how to use the sessions feature of PHP to carry that data over. an example of either would help alot.

IamShipon1988
So why don't you store this damage to the database and on the next page just load that variable from the database. It's a matter of storing and retrieving.

I'm going to move this topic off to server side programming as this is not possible without ss-code. The best language to use in this scenario is of course PHP.
NDBoost
why use a database when a session or cookie will handle the job fine?

CODE
<?php
session_start();
$_SESSION['listvar'] = $_POST['listval'];
echo $_SESSION['listvar'];
?>


Something like that.. $_POST['listval'] is the select list value that was selected. sets it to a session to be recalled.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2013 Invision Power Services, Inc.