Jump to content
php.lv forumi

Recommended Posts

Posted

Sveiki tauta :)

 

Ir input lauki, kuri ģenerējās no datu bāzes,respektīvi, aiz vārds_ iet id.

Kā lai uztaisa tā, lai pēc submit pogas nospiešanas rediģējās visi lauki?

 

<form>
<input type="text" name="vards_1"></input>
<input type="text" name="vards_2"></input>
<input type="text" name="vards_3"></input>
<input type="submit"></input>
</form>

Posted

Es taisītu, lai lauki ir kā masīvs.

<form>
<input type="text" name="vards[1]" />
...
</form>

Tad attiecīgi pēc tam

foreach($_POST['vards'] as $id => $value){//updeito pēc $id ar jauno $value}

Posted
Kā lai uztaisa tā, lai pēc submit pogas nospiešanas rediģējās visi lauki?

 

Ko nozīmē - "rediģējas visi lauki"?

Tas jau nav svarīgi kā saucas lauki, tiem tu visiem arī tagad tiec klāt:

echo $_POST["vards_1"], "\n", $_POST["vards_2"], "\n", $_POST["vards_3"], "\n";

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...