Re: complex arrays

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

 



Oeps, it's already complex to explain this.
The array that needs to be created and read is looking like this

$vArray = array('uses'=>'J', $_POST['vke']);

Maybe that will clear up thing a (tiny) bit).
Thanks again,
Sjef

""Sjef Janssen"" <manuals-scripts@xxxxxxxxx> schreef in bericht 
news:A6.2C.34518.4117DB34@xxxxxxxxxxxxxxx
> Hallo there,
> I try to put a number of variables in an array as follows:
> input boxes gather info. This info is language dependent, so the info is 
> put
> into an array vke with indexes NL and EN. The POST variable gives this 
> array
> back. Then I want to add a variable to this array, 'gebruikt' (=used) with
> possible values J or N.
>
> The script looks something like so:
>
> <?php
>
> session_start();
>
>
> if ($_POST['vkePlus'])
> {
> $waarden[] = array('gebruikt'=>'J',$_POST['vke']);
> foreach ($waarden as $i=>$w)
> {
>  if (is_array($w))
>  {
>   foreach($w as $iw=>$ww)
>   {
>    if (is_array($iw))
>    {
> //What happening here???
>    }
>    else
>    {
>     echo stripslashes($iw) . ": " . stripslashes($ww) . "<br/>";
>    }
>   }
>  }
>  else
>  {
>   echo stripslashes($i) . ": " . stripslashes($w) . "<br/>";
>  }
> }
> }
>
>
> print ("<h1>Test</h1>\n");
> print ("<form method=\"post\" action=\"" . $_SERVER['PHP_SELF'] . 
> "\">\n");
> print ("<input type=\"text\" size=\"10\" name=\"vke[NL]\" value=\"" .
> $vke[NL] . "\">\n");
> print ("<input type=\"text\" size=\"10\" name=\"vke[EN]\" value=\"" .
> $vke[EN] . "\">\n");
> print ("<input type=\"submit\" name=\"vkePlus\" value=\"GoGo\">\n");
> print ("</form>\n");
> ?>
>
> I have problems reading the contents of the arrays. Especially reading the
> second array seems impossible.
> After all this I want to add the contents of the array to a Session 
> variable
> to keep it in furthwer steps (of a wizard).
>
> I hope any of you can 'make chocolat' of this.... ;-))
> Thanks!!
> Sjef
>
> p.s. I use php 4. 

-- 
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