chizijs Posted May 26, 2010 Report Share Posted May 26, 2010 (edited) Komats! Edited May 26, 2010 by chizijs Quote Link to post Share on other sites
gta1151 Posted May 26, 2010 Author Report Share Posted May 26, 2010 <?php $userid = $_GET['id']; $users = mysql_query("SELECT * FROM users WHERE id = '$userid'"); setcookie("$users", $value); setcookie("$users", $value, time()+3600); setcookie("$users", $value, time()+3600, "?", "Mana_lapa.lv", 1); ?> Kā izvadīt tur lasīju mēģināju tāpat nepieleca. Quote Link to post Share on other sites
briedis Posted May 26, 2010 Report Share Posted May 26, 2010 (edited) Ou, man pat grūti komentēt... Cepuma nosaukums ir mysql resurss?? :)) Edited May 26, 2010 by briedis Quote Link to post Share on other sites
rATRIJS Posted May 26, 2010 Report Share Posted May 26, 2010 o_O Paskaties ko vispar atdod mysql_query. To tu kukijā nepieglabāsi. Kam tev to vispār tur vajag? Ar ID pilnībā pietiktu. Tālāk - tev tāds $value vispār nepastāv. Re ku ir viss pilnībā paskaidrots http://uk2.php.net/setcookie (varbūt sapratīsi kur kas kā jāliek) Quote Link to post Share on other sites
emsy Posted May 26, 2010 Report Share Posted May 26, 2010 <?php $expire = time()+60*60*24*365*5; // izgdzīvotājs cepums - 5 gadi, cerams nesapelēs xD setcookie('cepums','cepuma vērtība',$expire,'/',$_SERVER['http_host']); ?> Quote Link to post Share on other sites
gta1151 Posted May 27, 2010 Author Report Share Posted May 27, 2010 (edited) Paldies emsy.Gribu pajautāt kā var piemēram lietotajs uztaisa iziet tad nepazūd cookie. Edited May 27, 2010 by gta1151 Quote Link to post Share on other sites
gta1151 Posted May 29, 2010 Author Report Share Posted May 29, 2010 Baigi ilgi nesaņemu atbildi. Quote Link to post Share on other sites
briedis Posted May 29, 2010 Report Share Posted May 29, 2010 Baigi ilgi nesaņemu atbildi. Jā, iedomājies, veselas 15 minūtes sestdienas (darba dienas) rītā neviens neatbild O_o Par sīkdatņu derīguma laiku - lasi manuāli. http://php.net/manual/en/function.setcookie.php Quote Link to post Share on other sites
gta1151 Posted June 8, 2010 Author Report Share Posted June 8, 2010 (edited) Divi jautājumi: 1) Automātiski izvelk niku kuru ir ielogojies 2) Kā piešķirt id automātiski. Edited June 8, 2010 by gta1151 Quote Link to post Share on other sites
briedis Posted June 8, 2010 Report Share Posted June 8, 2010 1) SELEC nick FROM 2) id kā ints ar auto_increment īpašību.. Quote Link to post Share on other sites
gta1151 Posted June 8, 2010 Author Report Share Posted June 8, 2010 (edited) 1)Biju domājis savādāk,sāku veidot pievienot jaunumu scriptu bet nezinu ka dabūt automātiski izvada niku. 2)auto_increment nevajag speciālu scriptu kas izvada sava id. Edited June 9, 2010 by gta1151 Quote Link to post Share on other sites
php newbie Posted June 8, 2010 Report Share Posted June 8, 2010 Biju domājis savādāk,sāku veidot pievienot jaunumu scriptu bet nezinu ka dabūt automātiski izvada niku. auto_increment nevajag speciālu scriptu kas izvada sava id. omfg tak nevar neko saprast Quote Link to post Share on other sites
marrtins Posted June 8, 2010 Report Share Posted June 8, 2010 Kārtējais :) Quote Link to post Share on other sites
gta1151 Posted June 9, 2010 Author Report Share Posted June 9, 2010 Ko never saprast. Quote Link to post Share on other sites
Леший Posted June 9, 2010 Report Share Posted June 9, 2010 gta1151, ja tu gribi programmēt, tev nāksies iemācīties lietot pieturzīmes. Cilvēki varbūt tavs tekstus arī sapratīs, bet PHP tavu kodu - diez vai. Quote Link to post Share on other sites
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.