Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Help setting and passing a variable

Status
Not open for further replies.

james0816

Programmer
Jan 9, 2003
295
US
I could use a little assistance here if you don't mind. I am trying to pass a value on to another page by using dynamic content. I can do it by hard coding but just not dynamically.

Here's what I got. I am populating a table on my page from a field (mname) in my database. I have it set as clickable to go to another page. I am using CS Action to do this as i am using frames. might not be the best way to do it but all i can work with at this time.

This is my statement which populates the table:

<td><font size="1"><font size="2"><a onclick="CSAction(new Array(/*CMP*/'C24BCE2'));return CSClickReturn();" href="#" csclick="C24BCE2"><?php echo $MemberList->Value("mname")?></a></font></font></td>

My CSACtion line:
CSAct[/*CMP*/ 'C24BCE2'] = new Array(CSPAKtrg2frames,'MemberInfo',/*URL*/ 'MemberInfo.php?name={desired value here}','Stats',/*URL*/ 'MemberStats.php');

Upon clicking the desired name, i need to pass that value to the other page to pull in more information.

did i confuse anyone as much as i have confused myself? Please let me know if you need more information....thank you very much
 
New array might work ok for javascript but dont think it will for PHP.

I think you may need to setup a form, name it Name[] with empty inside(on the HTML side), this signifies it can hold multiple values as opposed to "Name". CSAct[/*XMP*/ 'C24BCE2'] got me really confused as never seen a comment inside of the identifier.

Also How exactly is this information being submitted to the new age, I See CSAction, and such, but how is it actually being sent to the new page?

Karl Blessing
PHP/MySQL Developer
 
I new at PHP so bare with me, I'll try to get it.... A little more info. I am only displaying 4 records at a time on my page. (have eight records currently in the DB). When the page first loads, I see the following:

Test1
Test2
Test3
Test4

Using the following code on my page:
My action statement:

CSAct[/*CMP*/ 'C24BCE2'] = new Array(CSPAKtrg2frames,'MemberInfo',/*URL*/ 'MemberInfo.php?name=<?php echo $MemberList->Value("mname") ?>',/*URL*/ 'MemberStats.php');

I'm trying to pass the information via the NAME variable in the above line.

My table gets populated using the following:

<td><font size="1"><font size="2"><a onclick="CSAction(new Array(/*CMP*/'C24BCE2'));return CSClickReturn();" href="#" csclick="C24BCE2"><?php echo $MemberList->Value("screenname")?></a></font></font></td>


Here's where it gets interesting. As displayed above, if I click on Test1, 2, 3 or 4.....Test1 is the value that is passing to the MemberInfo Page via this statement: 'MemberInfo.php?name=<?php echo $MemberList->Value("mname") ?>'

If i click to view the next four records: Test5, 6, 7 8 and then try to pass the value, Test5 gets passed for all four of these records?

Hope that helps a bit?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top