Klez Posted March 25, 2006 Report Share Posted March 25, 2006 (edited) shaads skripta saakums ... <?php session_start(); $_SESSION['lang_id'] = 1; define("PIEEJA","labi"); require ("cfg.php"); require ("lv.msg.php"); if (!$_GET['id']) $_GET['id'] = 1; ?> <?xml version="1.0" encoding="utf-8"?> //shii ir 9 rindinja <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> izmet error ... Parse error: syntax error, unexpected T_STRING in index.php on line 9 short_open_tag = On ja short_open_tag = Off , tad viss lieliski straadaa :) Edited March 25, 2006 by Klez Link to comment Share on other sites More sharing options...
bubu Posted March 25, 2006 Report Share Posted March 25, 2006 Lielisks piemērs kāpēc nevajag lietot <? bet vajag lietot <? php un short_open_tag = off. Protams, to var elementāri apiet ar echo "<?xml ..."; bet nu tas nav pareizi. Pareizi ir aizliegt short open tagu un dzīvot laimīgi tālāk. Link to comment Share on other sites More sharing options...
Klez Posted March 25, 2006 Author Report Share Posted March 25, 2006 es jau uzliko short_open_tag uz off ... :) Link to comment Share on other sites More sharing options...
Grey_Wolf Posted March 25, 2006 Report Share Posted March 25, 2006 Klez --> divainis gan dazreiz esi ;) PHP.INI... -------- For portable, redistributable code, be sure not to use short tags. -------- ;) Link to comment Share on other sites More sharing options...
john.brown Posted March 25, 2006 Report Share Posted March 25, 2006 (edited) Bet viņš jau arī neizmantoja short :) Problēma ar xml`a paziņošanu radās short_open on dēļ. Tak daudziem hosteriem viņi ir on. Tā ka tik ar .htaccess mainīt... Vai droš paliek droš rakstīt echo '<?xml.. Edited March 25, 2006 by john.brown Link to comment Share on other sites More sharing options...
bubu Posted March 25, 2006 Report Share Posted March 25, 2006 john.brown: izlasi uzmanīgāk, ko Klez rakstīja - viņš teica, ka kļūda ir, ja uzliek to short open = on! un nav, ja ir off. Link to comment Share on other sites More sharing options...
john.brown Posted March 25, 2006 Report Share Posted March 25, 2006 (edited) bubu, nu bet pareizi! Kā tu domā, ko šitā html rindiņa '<?xml version="1.0" encoding="utf-8"?> ' izdos, ja būs short_open_tags = on? Droši vien, ka kļūdu :) Un viss būs ok, ja short_open_tags = off. Kodu ta viņš rakstīja normāli, ar off. Un tāpēc šinī gadījumā uzlikt test mašinai off un priecāties, ka viss iet nevar. Nebūs nekāds 'redistributable code', ja ,šo rindiņu nerakstīs caur echo... Ja kas, pats augstāk piedāvāji pareizu risinājumu šim trablam... Edited March 25, 2006 by john.brown Link to comment Share on other sites More sharing options...
Klez Posted March 25, 2006 Author Report Share Posted March 25, 2006 (edited) galu galaa uz servera apache konfigam virtuaalaa hosta konfigaa var php piekonfigureet kaa vaik :P Edited March 25, 2006 by Klez Link to comment Share on other sites More sharing options...
bubu Posted March 25, 2006 Report Share Posted March 25, 2006 Tas ir slimi - piekonfigurēt apache serveri, lai nelabs kods "strādātu". Link to comment Share on other sites More sharing options...
v3rb0 Posted March 26, 2006 Report Share Posted March 26, 2006 a kas tur slikts ja <?xml version="1.0" .. ?> jāliek ar echo, bet visur citur templeitos var rakstīt <?=$foo?> short open tagi palielina templeita pārskatamību. Link to comment Share on other sites More sharing options...
Recommended Posts