Re: problems with variables

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

 



Sorry, I see that I've got the a's and q's mixed up.
I'll try to clarify it some more by giving an example with 2 variables.

$q1 = "first_var";
$q2 = "second_var";
for($i=1;$i<=2;$i++)
{
   echo "<input type=\"hidden\" name=\"q$i\" value=\"$q$i\">\n";
}
The output should now be:
<input type="hidden" name="q1" value="first_var">
<input type="hidden" name="q2" value=\"second_var">

Hope you can help me,
    Marcel

----- Original Message -----
From: <no-spam----me@larrykagan.com>
Newsgroups: php.db
To: <php-db@lists.php.net>
Sent: Tuesday, February 04, 2003 3:24 AM
Subject: Re: problems with variables


> Marcel <m.h.a.reuvekamp@student.utwente.nl> wrote:
> Can you clarify? Possibly show how the  result should look in the page
after
> parsing.  I'm sure I can help but your question is a bit unclear.
>
>
> > I want to pass some variables named a1, a2...aX in a form. So I wrote a
> > couple of lines to do the trick:
> > for($i=1;$i<=$X;$i++)
> >  {
> >    echo "<input type=\"hidden\" name=\"q$i\" value=\"$q$i\">\n";
> >  }
>
> > But there is just one problem. How do I pass the correct value?
> > This is what I want the loop to do:
> >    echo "<input type=\"hidden\" name=\"q1\" value=\"$q1\">\n";
> >    echo "<input type=\"hidden\" name=\"q2\" value=\"$q2\">\n";
> >   ...........
> >   ...........
>
> > So I want to make the variables $q1 .. $qX from q$i
> > Is this possible and if so, how?
>
> > Thanks for your support,
> >     Marcel
>
>
>



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


[Index of Archives]     [PHP Home]     [PHP Users]     [Postgresql Discussion]     [Kernel Newbies]     [Postgresql]     [Yosemite News]

  Powered by Linux