Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.php > #17220

Re: Performace of form with lot alternate php and html

From Thomas 'PointedEars' Lahn <PointedEars@web.de>
Newsgroups comp.lang.php
Subject Re: Performace of form with lot alternate php and html
Date 2016-12-15 15:29 +0100
Organization PointedEars Software (PES)
Message-ID <2832986.AJdgDx1Vlc@PointedEars.de> (permalink)
References <3806c11e-2655-4ad1-b652-1e95df557756@googlegroups.com> <92f78771-d295-58ae-f8b3-87097320b02d@arnowelzel.de> <2531771.e9J7NaK4W3@PointedEars.de> <e2914606-4e75-4188-9486-206d20aa511e@googlegroups.com>

Show all headers | View raw


dino.liberale@gmail.com wrote:

[Restored attribution]

> [Thomas 'PointedEars' Lahn wrote: ]
>>    value="<?= htmlspecialchars(stripslashes($rec[0]['codiceamm'])) ?>
>> 
>> Calling stripslashes() should not be necessary to begin with, though.
>> Simply set the “magic_quotes_gpc” setting, which is DEPRECATED as of
>> PHP 5.3.0 (where the default was still "on") and was REMOVED as if
>> PHP 5.4.0, to "off" (0).  In fact, if you really need to rely on
>> stripslashes(), you better upgrade your PHP version and find ways
>> to remove stripslashes() from your code.
>> 
>> Finally, markup *templates* can be read and written by people who
>> do not know PHP, later to be augmented with source code by people
>> who do know PHP, which makes collaboration easier.  This is where
>> template engines like Smarty come in where PHP code for control
>> statements like loops and for inserting values escaped into
>> the markup is largely replaced by code in a templating language.
> 
> I thanks all for your good aswers

You are welcome.

But please keep the attribution from now on.  It is important to know who 
wrote the text which was quoted.  But it should be only one line for each 
quotation level.  That is easier to read.  You should make it shorter if it 
is too long for one line (more than 72 characters).  You can make it shorter 
if you delete everything except the name of the author.  See above.

You are using Google Groups.  You should subscribe to the newsgroup.  Then 
you can post with your real name, which is polite.  And your name will 
appear in attributions, as is should be.  But Google Groups has a lot of 
errors.  So Google Groups postings are harder to read.  Also, many bad 
people are (ab)using Google Groups: spammers and trolls.  So it is often 
filtered out.  (That is also why my reply is late.  I did not see your 
posting until today.)  You should use a newsreader application instead, for 
example KNode or Mozilla Thunderbird.

<http://twovoyagers.com/improve-usenet.org/>

> and apologise because I am a neanderthal php programmer :(

<http://catb.org/esr/faqs/smart-questions.html#idm45835691819312>

> Two more questions:
> I use stripslashes($rec[0]['codiceamm']) to suppress values with possible
> slashes stored in db field, you say it isnt necessary but I have not
> understand (all because of my bad english) how to do without. Can explain
> in poor words ?

(You probably mean “in _few_ words”.  OK, I tried to write in Simple English 
here [1].)

stripslashes() removes and reduces *back*slashes (“\”).  The function name 
is misleading:

<http://php.net/stripslashes>

It should not be necessary to remove or reduce backslashes.  Because there 
should not be extra backslashes in the database.  *You* have put them there.
Do not do that.  Problem solved.
 
> Second question, is best for me remain a neanderthaler or grow,

<http://catb.org/esr/faqs/smart-questions.html#idm45835691819312>

> maybe by a simple framework, you sed "smarty", is one possible way ?

Smarty is a not a (PHP) framework.  It is a (PHP) library.  This library 
provides a (PHP) template engine.  A (PHP) template engine helps you to 
write (PHP) templates in an easy way.  It uses a more simple syntax.

HTH.

_______
[1] <http://en.wikipedia.org/wiki/Simple_English>
-- 
PointedEars
Zend Certified PHP Engineer <http://www.zend.com/en/yellow-pages/ZEND024953>
<https://github.com/PointedEars> | <http://PointedEars.de/wsvn>
Twitter: @PointedEars2 | Please do not cc me./Bitte keine Kopien per E-Mail.

Back to comp.lang.php | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Performace of form with lot alternate php and html dino.liberale@gmail.com - 2016-11-02 08:19 -0700
  Re: Performace of form with lot alternate php and html Jerry Stuckle <jstucklex@attglobal.net> - 2016-11-02 14:45 -0400
  Re: Performace of form with lot alternate php and html Arno Welzel <usenet@arnowelzel.de> - 2016-11-03 08:16 +0100
    Re: Performace of form with lot alternate php and html Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2016-11-03 15:24 +0000
      Re: Performace of form with lot alternate php and html dino.liberale@gmail.com - 2016-11-03 12:15 -0700
        Re: Performace of form with lot alternate php and html Jerry Stuckle <jstucklex@attglobal.net> - 2016-11-03 18:59 -0400
          Re: Performace of form with lot alternate php and html Arno Welzel <usenet@arnowelzel.de> - 2016-11-07 09:41 +0100
        Re: Performace of form with lot alternate php and html Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2016-12-15 15:29 +0100
      Re: Performace of form with lot alternate php and html Arno Welzel <usenet@arnowelzel.de> - 2016-11-07 09:39 +0100
        Re: Performace of form with lot alternate php and html Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2016-11-07 19:08 +0100
          Re: Performace of form with lot alternate php and html Arno Welzel <usenet@arnowelzel.de> - 2016-11-07 23:53 +0100

csiph-web