LorDRameX Posted March 4, 2012 Report Share Posted March 4, 2012 mekleetaaju nemaaku izmantot (ti nepaliidz) sanaaca peec krietna laika izvilkt vecu kodu kura ir izamntot primitiiva mysql klase secinaajums uz 5.3.x nestradaa vairs vinja lapa izdruka kodu iekh html peec pirmaa $this-> <? class adminTool { private $db = array(); public function __construct() { $this->db["db_username"] = "root"; $this->db["database"] = "database"; $this->db["db_password"] = "password"; $this->db["hostname"] = "localhost"; $this->db["connected"] = false; $this->db["result"] = ""; } private function open() { if($this->db["connected"] != true) { $this->db["connection"] = @mysql_connect($this->db["hostname"], $this->db["db_username"], $this->db["db_password"]); mysql_select_db($this->db["database"]); $this->db["connected"] = true; apstraade tiek norauta pie $this->db['db_username'] = 'root'; un tiek izdrukaats db['db_username'] = 'root'; un viss atlikushais kods iesperat mulkjim kura virzienaa mekleet, kas ir mainijies (PS PHP neesmu izmantojis nopietni gadus triis :/ tapec nezinu kas ir mainiijies pa sho laiku) Quote Link to comment Share on other sites More sharing options...
Kaklz Posted March 4, 2012 Report Share Posted March 4, 2012 short_open_tag kopš PHP 5.3.x liekas ir izslēgts pēc noklusējuma. http://php.net/manual/en/ini.core.php Quote Link to comment Share on other sites More sharing options...
LorDRameX Posted March 4, 2012 Author Report Share Posted March 4, 2012 bet tada gadiijumaa tak nenoparseetos liidz konkreetai vieta bet paradiitu visu faila saturu? Quote Link to comment Share on other sites More sharing options...
codez Posted March 4, 2012 Report Share Posted March 4, 2012 Ar <? tu atver tagu ar -> aizver tagu. Browserī izdrukājas tas, kas ir starp tagiem, ja uzliksi view source, drošvien redzēsi visu. Quote Link to comment Share on other sites More sharing options...
LorDRameX Posted March 5, 2012 Author Report Share Posted March 5, 2012 hmm, laikam jau ta sanaak, kauak mulkjiigi buus japamekle par ko vinji tik ljauni ar short open tag apgajaas, daudz vietas koda ir short echo etc :/ <?=$foo?> naksies pakasiit pakausi via tomeer iiesleegt short open tags ieksh settingiem vai parrakstiit visu :/ Quote Link to comment Share on other sites More sharing options...
Lauris Posted March 5, 2012 Report Share Posted March 5, 2012 PHP 5.4: "<?= is now always available regardless of the short_open_tag setting." Quote Link to comment Share on other sites More sharing options...
Kaklz Posted March 5, 2012 Report Share Posted March 5, 2012 Slēdz droši iekšā. short_open_tag nav nekas slikts. Quote Link to comment Share on other sites More sharing options...
briedis Posted March 5, 2012 Report Share Posted March 5, 2012 Lauri, <?=, nevis <?, tā kā shortttagi tāpat būs jāieslēdz... Nez, es vienmēr izmantoju shorttagus, ir taču tik sasodīti ērtāk... Quote Link to comment Share on other sites More sharing options...
Kavacky Posted March 5, 2012 Report Share Posted March 5, 2012 Jā, briedi, tik bieži taču nākas to atverošo tagu rakstīt... katra faila sākumā. Un īpašiem mazohistiem taču katra faila beigās ir jāliek arī aizverošais! Quote Link to comment Share on other sites More sharing options...
briedis Posted March 5, 2012 Report Share Posted March 5, 2012 Nu ne jau visi izmanto ūbero Smarty templeitu sistēmu, bet gan raksta <?=$trololol templeitos :) Quote Link to comment Share on other sites More sharing options...
daGrevis Posted March 5, 2012 Report Share Posted March 5, 2012 Tagad tu, briedi, nejauc <?php, <? un <?=..... Quote Link to comment Share on other sites More sharing options...
codez Posted March 5, 2012 Report Share Posted March 5, 2012 templeitos var nākties arī rakstīt if-us un ciklus ar <? if () { ?>... vai <? foreach() { ?>... Quote Link to comment Share on other sites More sharing options...
Lauris Posted March 5, 2012 Report Share Posted March 5, 2012 @briedis, es par autora pēdējo komentāru. Quote Link to comment Share on other sites More sharing options...
daGrevis Posted March 6, 2012 Report Share Posted March 6, 2012 Es un mani kolēģi esam vienojušies izmantot _alternative syntax_ iekš skatiem... tas izskatās: <?php if (true): ?> <!-- HTML --> <?php endif ?> <?php for ($i = 0; $i < 10; ++$i): ?> <!-- HTML --> <?php endfor ?> Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.