Jump to content

Archived

This topic is now archived and is closed to further replies.

deeep

a help for arrays please do read

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

Share this post


Link to post
Share on other sites
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--]

Share this post


Link to post
Share on other sites

×

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.