Re: [Phplib-users] phplib templates
Brought to you by:
nhruby,
richardarcher
|
From: Layne W. <la...@if...> - 2001-10-23 15:14:13
|
> Thanks for all your help.
> I figured out that I am using the same var-names in the
> templates as in the
> PHP-code (no problem without templates). When you submit data
> the data from
> the PHP-vars is submitted instead of the HTML-data. Changing
> the var-names
> in the template is a solution (this works), but I think it's
> a dirty one.
> Isn't there a workaround. Or do I have to parse back the
> values from the
> template?
The problem is not templates, but the logic. You have two options:
1. Check for a form submit first. (My prime directive is always check for
user input and verify the integrity of that input before doing anything
else.)
2. Use the $HTTP_POST_VARS array in your update statement. (You check for
$id, but do not use it. What is it's function? Is it necessary?)
$sql = "UPDATE klant SET
klant_naam = '$HTTP_POST_VARS[klant_naam]',
...
Layne Weathers
Ifworld Inc
> -----Oorspronkelijk bericht-----
> Van: php...@li...
> [mailto:php...@li...]Namens Layne Weathers
> Verzonden: maandag 22 oktober 2001 23:43
> Aan: php...@li...
> Onderwerp: Re: [Phplib-users] phplib templates
>
>
> > I am writing a project in PHP and I want to use templates
> > (phplib) to keep
> > my html separated from code.
> >
> > Passing values from the php-code to the template works perfect!
> > Now I am trying to submit values in the form, but this is a
> > problem. When I
> > submit the old values in the form are submitted instead of
> the changed
> > values.
> >
> > What am I doing wrong??
>
> It sounds like your browser is caching the results of the page - you
> wouldn't happen to be using Internet Explorer 5 for Windows,
> would you?
>
> This problem is addressed in PHPLib's session handling
> classes. Look in
> session.inc at lines 462 to 466 - either use PHPLib's
> sessions or make sure
> those lines get included into the beginning of each page in
> your project.
>
>
> > Any help would be appreciated.
> >
> > // code included in attachment.
>
> I would also recommend using PHPLib's nice database class and strongly
> encourage you to use a non-root mysql user for your websites.
>
>
> Layne Weathers
> Ifworld Inc
|