You are here: Re: Form Arrays « PHP Programming Language « IT news, forums, messages
Re: Form Arrays

Posted by The Natural Philosopher on 09/04/07 17:23

Kevin Davis wrote:
> On Sep 4, 10:14 am, ELINTPimp <smsi...@gmail.com> wrote:
>> On Sep 4, 11:00 am, Kevin Davis <kevin.da...@kevincdavis.net> wrote:
>>
>>> Hello,
>>> I'm a new person when it comes to PHP and I have a quick question.
>>> I would like to create a form that will allow the user to add more
>>> information using the same form in case they have (similar to various
>>> employment sites).
>>> What would be the best way of using form arrays for that function?
>>> Thank you,
>>> Kevin
>> Hi Kevin,
>>
>> I'm not sure exactly what you want to do...using your example of an
>> employment site...do you have a form that gathers a users employment
>> history, for example? And, if the employee has more than one previous
>> employer, to return to the same form so they can enter more
>> information? And, I assume, you do not want to submit the data to
>> persistent storage (ie database) until they are complete with the
>> form? If I'm off, let me know, just need clarification...
>
> Sorry about that I should added some claficiation.. The example would
> be if the user has more than one previous employer and they have add
> more until they are done. That is correct I don't want the user to
> enter the information to the database until they are done.
>

Very hard to add an infinite number of items and THEN commit.

Best is maybe to build a temporary thing and then make it permanent, or
delete it, if they commit/don't commit.

So using some form of persistent session Id set up a 'new set of
records' by

- creating a new header with their details, and the date inserting it
and returning a unique number for that person, but flag the record as
'unsubmitted' Carry that number as a POST variable through the whole
session.

-loop through a series of the same form adding more records linked to
the record_headers id. key.

- allow them at any time to review this

- when done hit the big red button, and all that you then do is flag the
master record as 'submitted'.

'unsubmitted' data can be cleaned up and deleted once every so often.

Viz. Run this every night.

delete from records, record_headers where
record_headers.flag='unsubmitted' and
records.header_id=record_headers.id and
(record_header.date+1)<(todays_date())

In sort of pseudo-SQL spik.





> Thanks..
>

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация