torrentz Posted September 15, 2007 Report Share Posted September 15, 2007 (edited) Vai kāds var man palīdzēt izlabot šo kļūdu: Parse error: syntax error, unexpected T_STRING in E:\xampp\htdocs\engtop\test3.php on line 37 skripta adrese: http://paste.php.lv/6045 Ceru uz Jūsu atsaucību :) Edited September 15, 2007 by torrentz Link to comment Share on other sites More sharing options...
Kristabs Posted September 15, 2007 Report Share Posted September 15, 2007 Neatradu kļūdu, bet katrā ziņā šo $reg = mysql_query("SELECT * FROM `os_stats` WHERE `id`='" . $did . "';); $rozs = mysql_fetch_assoc($reg); $sytem = $rozs[$os]; $sytem++; @mysql_query("UPDATE `os_stats` SET `".$os."`= '".$sytem."' WHERE `id`='" . $did . "';"); Var aizvietot ar vienu kveriju: mysql_query("UPDATE `os_stats` SET `".$os."`= `".$os."` + 1 WHERE `id`='" . $did . "'"); Link to comment Share on other sites More sharing options...
hackerman Posted September 15, 2007 Report Share Posted September 15, 2007 @mysql_query("UPDATE `os_stats` SET `".$os."`= '".$sytem."' WHERE `id`='" . $did . "';"); Kapē tur ir semikols ? Link to comment Share on other sites More sharing options...
torrentz Posted September 15, 2007 Author Report Share Posted September 15, 2007 Pladies, Kristab :) Tagad viss itkaa straadaa =) Link to comment Share on other sites More sharing options...
torrentz Posted September 15, 2007 Author Report Share Posted September 15, 2007 man gadiijumaa nevajag aizvietot strstr uz strpos? Link to comment Share on other sites More sharing options...
andrisp Posted September 15, 2007 Report Share Posted September 15, 2007 torrentz, šīm fjām ir atšķirīga funkcionalitāte. Izmanto, to ko tev vajag (To, ko dara katra fja, vari izlasīt manuālī). Mēs tev nevar pateikt, ko tev izmantot. Link to comment Share on other sites More sharing options...
torrentz Posted September 16, 2007 Author Report Share Posted September 16, 2007 (edited) I taada lieta, ka man visi user agenti sanaak kaa "Other", lai gan vismaz 40% user agentu vajadzeetu buut ar kaadu noshiim OS. Doma ir taada ka pilnajaa user agentaa, piemeeram: Nokia6680/1.0 (4.04.07) SymbianOS/8.0 Series60/2.6 Profile/MIDP-2.0 Configuration/CLDC-1.1, Mozilla/4.0 (compatible; MSIE 6.0; Windows 95; PalmSource; Blazer 3.0) 16;160x160 ir jaatrod kaada no shiim opereetaajsisteemaam.. Edited September 16, 2007 by torrentz Link to comment Share on other sites More sharing options...
cucumber Posted September 16, 2007 Report Share Posted September 16, 2007 salidzini sho rindu izmantojot, preg_match f-ju. Link to comment Share on other sites More sharing options...
torrentz Posted September 16, 2007 Author Report Share Posted September 16, 2007 (edited) $string = $_SERVER['USER_AGENT']; if (preg_match('@SymbianOS/9.1@', $string)) { $os = "SymbianOS/9.1";} else if { (preg_match('@SymbianOS/9.2@', $string)){$os = "SymbianOS/9.2";} else if { (preg_match('@Series80@', $string)){$os = "Series80";} utt.... else {$os = "Other";} Vai tā ir pareizi? Es īsti nezinu kādus simbolus jāizmanto @ vietā :) Vai kāds nevarētu pateikt priekšā? Edited September 16, 2007 by torrentz Link to comment Share on other sites More sharing options...
martins256 Posted September 16, 2007 Report Share Posted September 16, 2007 http://www.google.lv/search?hl=lv&q=Re...4%93t&meta= pirmais links: http://weblogtoolscollection.com/regex/regex.php Link to comment Share on other sites More sharing options...
torrentz Posted September 16, 2007 Author Report Share Posted September 16, 2007 cik es sapratu, tad man nevajag nevienu simbolu tur likt :D Link to comment Share on other sites More sharing options...
Kristabs Posted September 16, 2007 Report Share Posted September 16, 2007 Pēdējā laikā preg_match ir populārs, tipa var izdarīt visu ;)) Kārtējā vieta, kur viņš nav vajadzīgs... $string = $_SERVER['USER_AGENT']; if(strpos(strtolower($str),strtolower("SymbianOS/9.2"))){ $os = "SymbianOS/9.2"; } elseif(strpos(strtolower($str),strtolower("Series80"))){ $os = "Series80"; } else{ $os = "Other"; } Link to comment Share on other sites More sharing options...
torrentz Posted September 16, 2007 Author Report Share Posted September 16, 2007 (edited) $str vietaa laikam vajag $string :) un elseif jaaraksta kopaa vai atsevishjki? Edited September 16, 2007 by torrentz Link to comment Share on other sites More sharing options...
torrentz Posted September 16, 2007 Author Report Share Posted September 16, 2007 bet probleema ir taa ka jebkuraa gadiijumaa vienmeer sanaak user agent ir "Other". Li gan mans user agnet ir Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.6) Gecko/20070725 Firefox/2.0.0.6, un shajaa user agentaa ir Windows NT 5, tomeer skripts pievieno datubaazee +1 vieniibu pie other.. Link to comment Share on other sites More sharing options...
martins256 Posted September 16, 2007 Report Share Posted September 16, 2007 gan else if, gan elseif ir pareizi! Link to comment Share on other sites More sharing options...
Recommended Posts