php - Change values in array by forms values send -


I have 2 arrays.
The first array in the text contains table names for ordinary db
Each table has the value of the second array.

When I send my form from the form and the value of the table table is equal, send the value to the form.

Script:

  & lt ;? Php if (send $ _ POST == "OK") {/// Structure This is fixed in that, array_1 and 2 /// $ table = "name, phone, surname"; $ Values ​​= "John, 55543232, johny25"; /// Explosion values ​​in each case /// $ exp_tables = explosion (",", $ table); $ Exp_values ​​= explosion (",", $ value); /// To get value for each field array /// $ i = 0; Foreign exchange ($ exp_tables $ exp_table as) {$ {$ exp_table} [] = "". $ Exp_values ​​[$ i] ""; $ I ++; } /// To get the BQL results, if the Verses send from the equivalent form of other wars and send the changes by the new value then form /// foreach ($ exp_tables $ as table) {foreach ($ _ POST as $ Key = & gt; $ value) {if ($ table == "." $ Key "") {print "" $ _ POST [$ table] ""; } Else {print "". $ {$ Table} {0} ""}}}}}? & Gt;   

HTML Forms

  & amp; Ltd. 
& Lt; Input type = "submit" name = "submit" value "send" /> & Lt; Input type = "hidden" name = "send" value = "ok" /> & Lt; / Form & gt;

In the form I have "Name" in the first field and in the array tables, I also have a field named.

When I send the form, I will have to get it:

  zone (value change by value), 55543232, JOI 25   

The problem repeats the values ​​of all times and the results are not correct.

My question is:: To change the way I send values, and other values ​​are the names in array tables, but no work is very good. First, enter your variable $ table a $ value

There are no arrays, but strings.

An array looks

array (value, value, value)

or

In your case,

  $ tables = array (Array => value, key = & gt; value, key value) 'Name', 'phone', 'alias'); $ Values ​​= array ('john', '55, 543,232 ',' johny25 '); // or even simple $ value = array ('name' = & gt; 'Jhon', 'phone' = & gt; '55543232', 'alias' = & gt; JOI 2525) for;   

Then, if you want to produce only the name and check whether the name is different from that array, then you just do it:

  If ($ _POST ['name'] == $ value ['name']) {print "". $ _ POST ['name'] ""; } Other {print "". $ Value ['name']. ""; }    

Comments

Popular posts from this blog

java - ImportError: No module named py4j.java_gateway -

python - Receiving "KeyError" after decoding json result from url -

.net - Creating a new Queue Manager and Queue in Websphere MQ (using C#) -