| We hope you enjoy your visit. You're currently viewing our forum as a guest. This means you are limited to certain areas of the board and there are some features you can't use. If you join our community, you'll be able to access member-only sections, and use many member-only features such as customizing your profile, sending personal messages, and voting in polls. Registration is simple, fast, and completely free. Join our community! If you're already a member please log in to your account to access all of our features: |
| php need help | |
|---|---|
| Topic Started: Nov 1 2009, 08:48 AM (184 Views) | |
| Black Shadow | Nov 1 2009, 08:48 AM Post #1 |
|
Join the Dark Side...We have cookies :)
![]() ![]() ![]() ![]() ![]() ![]()
|
I have this list and it generates a drop down list.I want to assign one of those values to a variable. How do I do it i can't figure it out
|
![]() |
|
| dZ | Nov 1 2009, 10:10 AM Post #2 |
|
Member
![]() ![]() ![]() ![]()
|
$name = 'activation_word'; $$name = word; echo $activation_word; // outputs: word |
![]() |
|
| Black Shadow | Nov 1 2009, 10:26 AM Post #3 |
|
Join the Dark Side...We have cookies :)
![]() ![]() ![]() ![]() ![]() ![]()
|
? i dont understand.. how would that help me.. whats is activation word and how do i assign the value from a list to a variable in your example ? i print my drop down menu using a function.. so it looks smth like this
Edited by Black Shadow, Nov 1 2009, 10:30 AM.
|
![]() |
|
| Jory | Nov 1 2009, 03:58 PM Post #4 |
![]()
|
dZ, variable variables are a rather complex topic that you really shouldn't try to tell a beginning coder about. They cause value and difficult to debug code, and should be avoided if possible. Black Shadow, so you have an array, and you want to take one value from that array and assign it to a variable? You could do that, like so:
Does that do what you want? |
![]() |
|
| Zefer | Nov 1 2009, 04:03 PM Post #5 |
|
Member
![]() ![]() ![]() ![]()
|
That code is not only invalid, it's completely irrelevant to the subject. Here's a solution, not sure if it's what you want - if it isn't then please just let me know and I'll change the code for you.
Hope that helps, Ryan. |
![]() |
|
| 1 user reading this topic (1 Guest and 0 Anonymous) | |
| « Previous Topic · Programming and Scripting Chat · Next Topic » |





![]](http://209.85.62.24/static/1/pip_r.png)




2:13 PM Nov 22