cyber_ghost Posted September 23, 2007 Share Posted September 23, 2007 I hope you can help this problem of mine.. Problem: how can i change the php variable name like name1 as variable to name2 as my new variable? Please help me this problem... thank in advance Quote Link to comment Share on other sites More sharing options...
trq Posted September 23, 2007 Share Posted September 23, 2007 I think you'll need to be a little clearer about your intentions. $name2 = $name1; Quote Link to comment Share on other sites More sharing options...
teng84 Posted September 23, 2007 Share Posted September 23, 2007 ${'name1'} = $name2; Quote Link to comment Share on other sites More sharing options...
cyber_ghost Posted September 24, 2007 Author Share Posted September 24, 2007 sorry guys... but i miss this thing for further clearer intention.. im creating now the dynamic name changing of names.. likewise... having a golfers name in the the drop down box... which been retrieve... using ajax... there are 5(five) drop down box in a group... and a group is dependent upon the selection of league leader... may even choose to have a 40 groups... once the league leader chooses a name ... besides that cell of the same row in the HTML table ...population in the additional field for the entry of comments... score... handicap and other related infos... my real problem is that during saving how to i call the variables which been added to the row after selecting a name in a drop down box? variable name are same with the name of textboxes that will be created in during the name selection of player? thank you Quote Link to comment Share on other sites More sharing options...
teng84 Posted September 24, 2007 Share Posted September 24, 2007 im creating now the dynamic name changing of names.. likewise... ??????? have you tried naming your dropmenu as array Quote Link to comment Share on other sites More sharing options...
cyber_ghost Posted September 24, 2007 Author Share Posted September 24, 2007 you mean calling the drop down box names in an array form saving after clicking the submit button? if yes, then how about the textboxes which is dynamically added using js? how those stuff are being saved? Quote Link to comment Share on other sites More sharing options...
teng84 Posted September 24, 2007 Share Posted September 24, 2007 yep... on your text box if that is onchange then pass the name of that field using ajax can be done using JS but i guess it will be long script Quote Link to comment Share on other sites More sharing options...
cyber_ghost Posted September 24, 2007 Author Share Posted September 24, 2007 ok.. what i nice mind of yours.. fellow.. how about changing the name of variable name in php like this scenario... changing the name of variable name using loops... for(loops) $new_name = $old_name[loops]; is this possible? Quote Link to comment Share on other sites More sharing options...
teng84 Posted September 24, 2007 Share Posted September 24, 2007 try for (statement here) { ${'name'.$counter} = value; } Quote Link to comment Share on other sites More sharing options...
cyber_ghost Posted September 24, 2007 Author Share Posted September 24, 2007 yessssssssssssssssssssssssssssssssssssssss.... what technique is that? fellow... can you explain it to me... i saw this code while im trying to approach about JSON.. Quote Link to comment Share on other sites More sharing options...
teng84 Posted September 24, 2007 Share Posted September 24, 2007 so i guess this is solve technique ? i don know ! all i know is that it will dynamically set the variable name $ determine varibles in PHP so if you have a string after that $ then it will be treated as variable thats the logic fellow Quote Link to comment Share on other sites More sharing options...
cyber_ghost Posted September 24, 2007 Author Share Posted September 24, 2007 yes.. ! i got it... Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.