[thelist] (no subject)

Stephane Gosselin stef at hy.cgocable.ca
Mon Jan 13 14:02:06 CST 2003


	Hey Tom.

I suggest u take time to read the man a few times. THis would greatly
reduce time spent writing emails to have evolters debug your code,
Altough the list is great for help... it's not the fastest way to learn
IMHO. ( Friendly advice, here). Learning by trial & error never was MY bag
anyhow.

By reading the man, & re-reading it over, including the user comments *
just as valuable as the man! *  on bottom of each page,  u will become
familiar with the syntax, u will get to grasp what can be done with your
constructs, and what can't .

Oh . Your code below would never work. Although the logic is fine, the
issues in the code are merely syntax errors wich could easily be avoided by
learning the language constructs properly in the first place.

$mail . i = $_POST[i];    would never work as the i is an unquoted string
to PHP.

I saw you quoted your first _POST variable $mail1 = $_POST["1"];  <-- that
one I believe doensnt explicitely HAVE to be quoted.

$mail . i = $_POST[i];  <--   Here, i is a string , so needs quotes (
Although I believe I saw some situation where they were not needded, I
always quote the strings)

Lastly, I think you would of needed or something close to that.


$mail . $i = $_POST[$i];




You wrote:


Hello,
I'm building a 'mail to friend' list where I have 10 form fields
labeled 1 through 10. In my php that processes the page, I thought
instead of doing:

$mail1 = $_POST["1"];

I would instead run through a loop to do it:
for($i = 1; $i <= 10; $i++) {
then I would dynamically set each variable. This was what I tried:

$mail . i = $_POST[i];

but this of course did not work. There must be a good way to do this
I would think...
Tom





More information about the thelist mailing list