Jump to content


Photo

a help for arrays please do read


  • Please log in to reply
1 reply to this topic

#1 deeep

deeep
  • New Members
  • Pip
  • Newbie
  • 1 posts

Posted 04 May 2006 - 02:56 PM

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

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

thanks in advance

#2 jeremywesselman

jeremywesselman
  • Members
  • PipPipPip
  • Advanced Member
  • 154 posts
  • LocationIndependence, KY

Posted 15 May 2006 - 07:39 AM

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




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users