Jump to content

Recommended Posts

Hi!!

I have to create a form with 2 textfields name and age
and i hv a button add
so i need to add my entries to an array each time im pressing add
and below the whole entries should be displayed and the new entry should be added at the bottom of the table entries
i dont know how to do this
is it possible to do this without session ???

[code]
<?php
$panier = array ( "article" => $_POST['article'],"quantite" => $_POST['quantite']);
echo $panier["article"];
echo $panier["quantite"];
?>[/code]

thanks in advance
Link to comment
https://forums.phpfreaks.com/topic/9058-a-help-for-arrays-please-do-read/
Share on other sites

  • 2 weeks later...
Every time that you try to update the information in the array by submitting the form, you are going to clear the previous data. That is unless you do use a session variable to hold the information.

If you expect the data to stay there for longer than one visit, you'll need to store it in a database or text file.

[!--coloro:#990000--][span style=\"color:#990000\"][!--/coloro--]Jeremy[!--colorc--][/span][!--/colorc--]
This thread is more than a year old. Please don't revive it unless you have something important to add.

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.   Restore formatting

  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.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.