( saxus | 2011. 09. 19., h – 12:19 )

Keves embert lattam igy kodolni PHP-ben meg C#-ban.

Ez pl. eredendoen hibas is:

//:: all litteral strings provided by a client must be escaped this way ::
//:: if you inject them into an HTML page ::
htmlspecialchars($name);

Sose ertettem, hogy minek szenvednek " -l, mikor escapelesek nelkul meg lehet uszni ' -l. Azon kivul PHP tudja a multiline stringeket is, nem kell plusz stringosszefuzeseket csinalni. Vagy ha mar ", akkor lehet \n-t is hasznalni.

$result  = "<html><head><title>Loan Calculator</title>" .
                  "<meta http-equiv=\"Content-Type\" content=\"text/html;" .
                  " charset=windows-1252\">" .[code]

if/endif -t se surun latok PHP kodban.

C#-os kodban ugyanaz... lehet hasznalni a @"" format, ahol nem kell stringosszefuzesekkel szenvedni, vagy ha mar ugy is valami buffer jellegut akar, akkor meg inkabb StringBuilder -t illene, megiscsak gyorsabb egy pottyet...

Ez meg kulon tetszik:

[code]And, yes I know that Windows Server is faster than Windows Desktop
            as Windows Desktop has been artificially limited to sell Windows
            Server licenses. The point here is that Linux *Desktop* is compared 
            to Windows *Desktop*.

----------------
Lvl86 Troll