Register Globals (more)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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 4

How 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@xxxxxxx">
<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@xxxxxxx">
<br>
...
<input type="hidden" name="NMax" value="29">

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux