Hi All
I am new to PHP so please tolerate my question....
I am using HTML form to POST values to PHP page using PHP_SELF ....
Everytime the user enters a new value and submits to PHP I would like to retain all the old values submitted by the user.
I tried to use array and pass array as hidden value from HTML but it didn't help..
will using $_SESSION help this issue or is there a better way to do it....
I would appreciate any help on this.
Thankks
Ish ..
html to php
Moderator: General Moderators
-
WebbieDave
- Forum Contributor
- Posts: 213
- Joined: Sun Jul 15, 2007 7:07 am
Re: html to php
With regards to the functionality you're after, sessions can be used for short-term value storage. Otherwise, a database would serve immensely better when longer term and/or larger storage is required.
Re: html to php
Hi Webbie
Thanks for your reply..
I am looking to store for short term .... ie .,. everytime the user enters a new value and submits I would like to show all the values entered by that user.
If I had to use session variable could you please give me an example of storing array in session.
Thanks
Ish ..
Thanks for your reply..
I am looking to store for short term .... ie .,. everytime the user enters a new value and submits I would like to show all the values entered by that user.
If I had to use session variable could you please give me an example of storing array in session.
Thanks
Ish ..
-
WebbieDave
- Forum Contributor
- Posts: 213
- Joined: Sun Jul 15, 2007 7:07 am
Re: html to php
Sure:
Code: Select all
session_start();
$arr = array('a', 'b', 'c');
$_SESSION['arr'] = $arr;