Jump to content

golden14

New Members
  • Posts

    5
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

golden14's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. It's not pulling from a URL, Flash is storing text box strings in variables using the URLVariables method in AS3. I have 4 groups of variables, each with a different prefix (rg1, rg2, rg3 and rg4). It works no problem when I try it with just one. But when I add that second grouping in there, it will POST it without giving an error but the echo sections will give an error. Thanks anyway though!
  2. I'm working on passing a lot of variables from Flash to PHP, and then back to Flash again. It works correctly when I run this: <?php for ($i=1; $i<31; $i++) { ${'rg1tName'.$i}=$_POST['rg1_'.$i]; if($i>1){ echo "&rg1_".$i. "=".${'rg1tName'.$i}; } else { echo "rg1_".$i. "=".${'rg1tName'.$i}; } } ?> But when I add more into the if/else statements (which I need to do), it doesn't work. <?php for ($i=1; $i<31; $i++) { ${'rg1tName'.$i}=$_POST['rg1_'.$i]; ${'rg2tName'.$i}=$_POST['rg2_'.$i]; if($i>1){ echo "&rg1_".$i. "=".${'rg1tName'.$i}; echo "&rg2_".$i. "=".${'rg2tName'.$i}; } else { echo "rg1_".$i. "=".${'rg1tName'.$i}; echo "rg2_".$i. "=".${'rg2tName'.$i}; } } ?> Using trial and error and commenting out different sections of the code and changing it (both the AS3 and the PHP), it seems like the problem is in the PHP in the echoing sections. Based on what you see here, is there something noticeably wrong? Thanks!
  3. Thanks for that explanation, that makes sense (too much sense now that I think about it). I had to make a few small changes, because due to the nature of how it comes back into the various text fields in flash, I had to use an "&" to split it up instead of the "<BR>". So here's the code now, and this does work correctly. Thanks for the help and taking the time to explain things, I really appreciate it. <?php for ($i=1; $i<4; $i++) { ${'tName'.$i}=$_POST['tName'.$i]; if($i>1){ echo "&tName".$i. "=".${'tName'.$i}; } else echo "tName".$i. "=".${'tName'.$i}; } ?>
  4. Thank you both for the help. The first bit of code didn't seem to work, so I tried the second way (changing GET to POST), and that worked well. You mention that doing it the second way won't allow me to access the variables later on, but since I POST instead of GET. Was that different in not allowing me to access them again later? Thanks again for the help.
  5. I have many variables (about 50) coming into PHP from Flash, and I wanted to optimize my PHP code using a loop, but I can't seem to get the correct syntax. Here is the working code I have so far (using just 3 as an example): <?php $tName1=$_POST['tName1']; $tName2=$_POST['tName2']; $tName3=$_POST['tName3']; echo "tName1=".$tName1; echo "tName2=".$tName2; echo "tName3=".$tName3; ?> And I would like to do that in a loop. Here's my incorrect attempt at that: <?php for ($i=1; $i<4; $i++) { $tName[$i]=$_POST['tName[$i]']; echo "tName$i"=.$tName$i; } ?> Any suggestions/help would be much appreciated, thanks!
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.