Re: New to PHP, need pointers to best practices for the design of an atypical web app
| From: | Alan Mead | Date: | Tue, 02 Jul 2019 18:41:04 +0000 |
| Subject: | Re: New to PHP, need pointers to best practices for the design of an atypical web app | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-326843@lists.php.net to get a copy of this message | ||
Thanks. I have a Perl simulation of the CAT working (which has all the
technical algorithms). What I need to do is build the user interface and
I/O (and translate the Perl algorithms to PHP) to allow real people to
take a CAT online for a research project. I agree that nailing down the
data structures, and understanding how a PHP app is constructed, have
been the two main issues.
I'm working on a v1 that will store a hidden/cookie session ID that will
be tied to a serialized object stored in a database to maintain state,
possibly like this: https://www.w3schools.com/php/php_sessions.asp
,
although it's not immediately apparent how I extend this model to store
sessions in a database.
If I use PHP sessions to maintain state in MySQL (as suggested on the
w3schools page above) does PHP delete old state? That might be a good
security measure and necessary for some applications, but (as you say)
I'll have all the data I want in that structure.
-Alan
On 7/2/2019 6:18 AM, Stephen wrote:
> I see storing data between page views as your big challenge.
> Maintaining a "state" for the user session.
>
> I am guessing that you have many questions, and that means lots of
> data. Using a database makes sense. PHP has fine interfaces to databases.
>
> And since the application will be used by others, they need a place to
> install their questions.
>
> If I was tasked with this project, I would start by documenting data
> structures and the algorithms. (Nicholas Worth)
>
> If I understand correctly, the user navigation through the test is the
> tricky part.
>
> Only when this is done, would I consider the PHP programming.
>
--
Alan D. Mead, Ph.D.
President, Talent Algorithms Inc.
science + technology = better workers
http://www.alanmead.org
"You're an interesting species. An interesting mix.
You're capable of such beautiful dreams, and such
horrible nightmares. You feel so lost, so cut off,
so alone, only you're not. See, in all our
searching, the only thing we've found that makes
the emptiness bearable, is each other."
-- Carl Sagan, Contact