[FX.php List] Best Practices for Forms

Derrick Fogle derrick at fogles.net
Mon Jul 17 14:40:32 MDT 2006


This is getting pretty far off-topic, but...

I first learned database-to-web scripting with Lasso. At the time,  
Lasso didn't have functions, but the methodology was to use includes  
where functions are often used in PHP. When I switched to PHP  
(without any training at all), I was a lot less frustrated using  
includes instead of functions simply because I never seemed to be  
able to keep the function parameters matched, and I seemed to always  
need to get a lot of data both in and out of functions.

Other PHP coders are horrified when they find out how I tend to abuse  
includes, but... it works for me. It seems to be a lot easier to work  
on smaller modular files than one huge file anyway (at least in my  
text editor).

On Jul 17, 2006, at 3:15 PM, Dale Bengston wrote:

> This is my approach as well, although I would not call it abuse. ;-)
>
> Dale Bengston
>
> On Jul 17, 2006, at 3:47 PM, Derrick Fogle wrote:
>
>> I use a lot of (actually, I abuse them) includes, too; you only  
>> need the session_start() on the 'root' page that generates  
>> headers. All the included files automatically inherit the parent  
>> file's variables, kinda like a function with a global (everything)  
>> in it.
>>
>> On Jul 17, 2006, at 2:31 PM, Jonathan Schwartz wrote:
>>
>>> Thanks Gjermund,
>>>
>>> To be honest, I have been unsuccessful getting sessions to work  
>>> at all up to this point.  I get the dreaded "Headers already  
>>> loaded" error....and I'm sure I know why.  I know about the rule  
>>> of placing the command at the very top of the page.  However, I  
>>> use a lot includes, and I've figured out that you can not put the  
>>> session_start()  command on any of the included pages because  
>>> they load after the base page had been loaded. Thus, the error.
>>>
>>> I think that I will have another try at it.
>>>
>>> Thanks.
>>>
>>> Jonathan
>>>
>>> At 8:42 PM +0200 7/17/06, Gjermund Gusland Thorsen wrote:
>>>> option 2 is the way to go
>>>>
>>>> Look up: session_start()
>>>>
>>>> Do FMNew
>>>> keep the -recid of current record in _SESSION variable
>>>> and do FMEdit on the next pages submitted.
>>>>
>>>> ggt667
>>>
>>>
>>> -- 
>>>
>>> Jonathan Schwartz
>>> Schwartz & Company
>>> 817 Marin Drive
>>> Mill Valley, CA 94941
>>> Phone: 415-381-1852
>>> jonathan at eschwartz.com - http://www.eschwartz.com
>>>
>>> _______________________________________________
>>> FX.php_List mailing list
>>> FX.php_List at mail.iviking.org
>>> http://www.iviking.org/mailman/listinfo/fx.php_list
>>
>>
>> Derrick Fogle
>> derrick at fogles.net
>>
>>
>>
>> _______________________________________________
>> FX.php_List mailing list
>> FX.php_List at mail.iviking.org
>> http://www.iviking.org/mailman/listinfo/fx.php_list
>
> _______________________________________________
> FX.php_List mailing list
> FX.php_List at mail.iviking.org
> http://www.iviking.org/mailman/listinfo/fx.php_list


Derrick Fogle
derrick at fogles.net





More information about the FX.php_List mailing list