Re: Register Globals (more)
| From: | Jochem Maas | Date: | Sun, 06 Nov 2005 11:59:36 +0000 |
| Subject: | Re: Register Globals (more) | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-225205@lists.php.net to get a copy of this message | ||
John Taylor-Johnston wrote:
Patience please :) See my html below. Basically, if type=checkbox is checked, I'm trying to build $to string in mail().stop using eval()! (you know the film SAW? well it's people who use too much eval() that end up chained to the raditator) also find out what the difference is betwewen using single and double quotes. also learn how/why to use isset(), and initializing your variables before using them... now look at this, I'm pretty sure ti will do what you want: <? $to = ''; for ($i = 1; $i <= $_POST["NMax"]; $i++) { $CheckVariable = isset($_POST["Check$i"]) ? $_POST["Check$i"]: false; $nameVariable = isset($_POST["name$i"]) ? $_POST["name$i"] : ''; $emailVariable = isset($_POST["email$i"]) ? $_POST["email$i"]: ''; if ($CheckVariable) { $to .= "\"$nameVariable\" <".$emailVariable.">,"; } } echo $to;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