Page 1 of 1
Workaround for using number at beginning of variable name?
Posted: Fri Jan 02, 2004 6:22 pm
by blckbrry
Is there a workaround for using a number at beginning of variable name?
I need to send variables received into my server side php page to a cgi script on another server. I can't change the variable names that I must send and they have names like: 2-name 3-name etc....
If I could use $2-name etc... that would be great, but I guess I can't. Any ideas?
Thanks!
Randall
Posted: Fri Jan 02, 2004 9:28 pm
by nigma
Workaround: Don't use numbers at the beginning of a variable
Why can't you use different var names? If I knew that then maybe together we could try to find a way to workaround the 'not being able to change the variable names'.
reason for variable
Posted: Fri Jan 02, 2004 9:39 pm
by blckbrry
I can't change the variable because the end cgi variable is processed by another company. Their cgi script is set up to receive "hidden" field variables from html Posts, and in that case having the naming "1-name" doesn't cause any problems. But I am trying to process in the background from Flash to PHP to their cgi script. You can't use numbers at the beginning of a variable name in actionscript either.
Does that explain more? Thank you!
Randall
Posted: Sat Jan 03, 2004 1:43 am
by nigma
Well if using Perl you can start your var names with a number then what you could do is:
1. Process the data with PHP using any variable name
2. When you're done processing with PHP you can send the user to a Perl script where the data that was processed on the PHP page is then moved to a name that works for the final Perl script(i.e. take whatever is in variable 'a' and put it variable '1').
3. After storing the processed data in a variable that is named according to guidlines then send the data off to the final Perl script (i.e. the companies Perl script)
Does this make sense? If not then let me know and I will try to explain my methodology more precisely.
Posted: Sat Jan 03, 2004 11:32 am
by blckbrry
Thanks for the suggestion,
I will try to learn some Perl. I just have never used it before!
Randall