Click to See Complete Forum and Search --> : a newbie's question:


zw1971
09-23-2003, 10:38 AM
I have the code like this:

for($i=0;$i<3;$i++)
{
$did_index="did".$i;
$_POST['$did_index'];

}

how can I get the $_POST['did0'], $_POST['did1'], $_POST['did2'] instead of value of $did_index.

Thanks

Jona
09-23-2003, 10:51 AM
for($i=0; $i<3; $i++){echo($_POST["did". $i]);}


[J]ona

pyro
09-23-2003, 11:05 AM
Or, with the method you were using:

<?PHP
for($i=0;$i<3;$i++) {
$did_index="did".$i;
echo $_POST[$did_index];
}
?>Just had to remove the quotation marks from around the $did_index (or use double quotes).

spykemitchell
09-23-2003, 11:12 AM
Remember when posting a message use a subject that realates to the topic unlike,

Please Help
I'm Stuck
Newbie Here
What's Wrong?
HELP!

Etc..

Use something like,

Failing Post Script
Pass Protection Script Not Working

Ok?

Just means people are more likely to read your post to help...

pyro
09-23-2003, 11:21 AM
Or better yet, just read the Message Posting Guidelines (http://forums.webdeveloper.com/announcement.php?s=&forumid=16). Also, I'm not sure there is much of a point to posting everytime/anytime anyone doesn't use a descriptive title...