html to php

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
IshGan
Forum Newbie
Posts: 4
Joined: Fri Jun 27, 2008 3:48 am

html to php

Post by IshGan »

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 ..
WebbieDave
Forum Contributor
Posts: 213
Joined: Sun Jul 15, 2007 7:07 am

Re: html to php

Post by WebbieDave »

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.
IshGan
Forum Newbie
Posts: 4
Joined: Fri Jun 27, 2008 3:48 am

Re: html to php

Post by IshGan »

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 ..
WebbieDave
Forum Contributor
Posts: 213
Joined: Sun Jul 15, 2007 7:07 am

Re: html to php

Post by WebbieDave »

Sure:

Code: Select all

session_start();
$arr = array('a', 'b', 'c');
$_SESSION['arr'] = $arr;
Post Reply