Re: Using require instead of redirect architecture

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



""Robert Erbaron"" <robert.erbaron@xxxxxxxxx> wrote in message news:6164eea0712191255s228a9b0qfbf261ecf9e483ac@xxxxxxxxxxxxxxxxx
1. p1.php would post to itself. Do data validation. After data validation
        upon error, include p1.php again with included error messages
        upon success, redirect to p3.php with congrats.

Yeah, I could do this, but it uses a redirect, and like you said, it's gnarly.

2.  p1.php would post to p2. perform data validation.
upon error, save data into session variable, redirect back to p1.php,
                display error messages inline
        upon success, redirect to p3.php, display congrats

I've already got this working, per thread of a couple days ago. But it
uses a redirect.

I personally like the second option. It is cleaner. Each page/script has a single purpose in life.
 It just makes better sense to my small little mind.

I agree as well. But I'm trying to get away from multiple trips to the
server for simple page calls, per some pundits on the list. :) So I'm
trying to learn a different architecture, and I'm not getting it yet.

--
RE, Chicago

Well, I would tend to agree with Jim, the second suggestion he had is the way I've seen this problem done the most. It works, it's simple and this way you have one less PHP file, just enter your data and congratulations. The load to the server shouldn't be any different if you did it the way you suggested. Oh, well just my opinion.

- Dan
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux