Register Globals (more)
| From: | John Taylor-Johnston | Date: | Fri, 04 Nov 2005 04:00:21 +0000 |
| Subject: | Register Globals (more) | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-225128@lists.php.net to get a copy of this message | ||
Patience please :)
See my html below. Basically, if type=checkbox is checked, I'm trying to build $to string in mail().
parse error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING line 4How do I rebuild this peice of code to be register_globals=off friendly? Just when I thought I was getting good. This keeps up, I'm changing back the php.ini myself. John 1>for ($i = 1; $i <= $_POST["NMax"]; $i++) 2>{ 3> $CheckVariable = "\{$_POST['Check$i']}"; 4> eval("\$CheckVariable = \"$CheckVariable\";"); 5> $nameVariable = "\{$_POST['name$i']}"; 6> eval("\$nameVariable = \"$nameVariable\";"); 7> $emailVariable = "\{$_POST['email$i']}"; 8> eval("\$emailVariable = \"$emailVariable\";"); 9> 10>#echo ${"Check$i"}; 11>#echo "$CheckVariable $emailVariable - $i<br>"; 12> 13>if ($CheckVariable) 14>$to .= "\"$nameVariable\" <".$emailVariable.">,"; 15> 16>} 17> 18>echo $to; <INPUT TYPE="checkbox" NAME="Check1" VALUE="John" CHECKED>"John" <input type="hidden" name="name1" value="John"> <input type="hidden" name="email1" value="John_cy@foo.com"> <br> <INPUT TYPE="checkbox" NAME="Check2" VALUE="Alessandra" CHECKED>"Alessandra" <input type="hidden" name="name2" value="Alessandra"> <input type="hidden" name="email2" value="alessandra_cy@foo.com"> <br> ... <input type="hidden" name="NMax" value="29">