Faks Posted September 15, 2010 Report Share Posted September 15, 2010 if(!$_SESSION['logged_in'] and $_SESSION['u_level'] != 4 and $_SESSION['u_level'] != 2) Labdien Damas un Kungi Ceru kartejo reizi atrisinat problemu (zel bet drusku apslimu un tada sajuta ka vis iet leni un tamlidzigi) ! Ja prieksa koda sakuma pieliek (!) noliegumu netiek izpildits neviens bet ja nonemt strada bet tad lietotas bez profila ari tad tiek klat taka butu isniegtas tiesibas ar 4 un 2 limena pieju tada luk ir mana problema :D ka Es to personigi saprotu kods ir gandriz pabeigts bet lidz galama nau savest lidz galam trukst kaut kada koda dala ka saprotu kaut kads noliegums kurs atgriez peeju neregistretam lietotajm :( ! Quote Link to comment Share on other sites More sharing options...
briedis Posted September 15, 2010 Report Share Posted September 15, 2010 Šitais ifs izpildīsies tikai tad, ja lietotājs nebūs ielogojies UN ja u_level nebūs vienāds ar 4 UN ja u_level nebūs vienāds ar 2 Quote Link to comment Share on other sites More sharing options...
codez Posted September 15, 2010 Report Share Posted September 15, 2010 if (ir_ielogojies and (ir_tiesibas_2 or ir_tiesibas_4)) Quote Link to comment Share on other sites More sharing options...
Faks Posted September 15, 2010 Author Report Share Posted September 15, 2010 (edited) Janemt Pamata ideju ka visiem lietotaja limeniem dod pieeju tad var rakstit sadi un vins nelau neregistretiem pa lapu loznat piemers if(!$_SESSION['logged_in'] or $_SESSION['u_level'] == 1 > 4) lidz galam ta ari nevaru izdomat ka piespiest lai vins nedod pieeju citiem lietotaju pieejas limeniem un nerada koda caurumu kurs dod ari pieeju neregistretam lietotajm . ka saprotu citas izejas var nebut ka vien rakstit funkciju kura visu parbaudis . Edited September 15, 2010 by Faks Quote Link to comment Share on other sites More sharing options...
Faks Posted September 15, 2010 Author Report Share Posted September 15, 2010 Paldies Par Jusu Visu Laiku Izdomaju ka to uzrakstit izradijas diezgan pratigi :D seit bus piemers ! if(!$_SESSION['logged_in'] or $_SESSION['u_level'] == 4 xor $_SESSION['u_level'] != 2) Quote Link to comment Share on other sites More sharing options...
bubu Posted September 15, 2010 Report Share Posted September 15, 2010 $_SESSION['u_level'] == 4 xor $_SESSION['u_level'] != 2 ir kautkāda aplamība. Jo ja jau u_level == 4 tad, tas nu nekādīgi nevar būt vienāds ar 2. Respektīvi: true xor true = false. Tātad šī xor izteiksme tev vienmēr dos false vērtību. Quote Link to comment Share on other sites More sharing options...
viena tante Posted September 15, 2010 Report Share Posted September 15, 2010 (edited) if(!isset($_SESSION['logged_in']) or $_SESSION['u_level'] != 4 or $_SESSION['u_level'] != 2) tas nozīmē, ja kāds no nosacijumiem izpildīsies tad rezultāts būs true Edited September 15, 2010 by viena tante Quote Link to comment Share on other sites More sharing options...
Faks Posted September 15, 2010 Author Report Share Posted September 15, 2010 (edited) toko es uzrakstiju ir vienkarsi un praktiski seit ir Bibeles Bausli Kuri Ir Jatceras vai vismaz aci jauzmet . == salidzinasana - ir vienads != nav vienads > lielaks >= lielaks vai vienads < mazaks <= mazaks vai vienads ! noliegums (preteji) or logiskais vai (apzime ar ||) - izpildas viens vai otrs vai abi and logiskais un (apzime ar &&) - izpildaas abi xor logiski izsledzosais vai - izpildas tikai viens no diviem Ja ir velesanas te ari ir tas blogs http://faksx.sytes.net/blogs/ User lietotajs kods tads pats pieejas limenis 1 sadala 2 visu skaidri var sparast . Edited September 15, 2010 by Faks Quote Link to comment Share on other sites More sharing options...
php newbie Posted September 16, 2010 Report Share Posted September 16, 2010 omg vēl pastāsti kas ir 'if' un tak sāc lietot komatus Quote Link to comment Share on other sites More sharing options...
Aleksejs Posted September 16, 2010 Report Share Posted September 16, 2010 vaiespareizisapratukavajagizdariittaalaikadkadlietotaajsirielogojiesunvainuliimenii4vailiimenii2tadvinjunelaizhtaalaak? Quote Link to comment Share on other sites More sharing options...
Леший Posted September 16, 2010 Report Share Posted September 16, 2010 if(!$_SESSION['logged_in'] || ($_SESSION['u_level'] != 4 && $_SESSION['u_level'] != 2)) Quote Link to comment Share on other sites More sharing options...
Faks Posted September 16, 2010 Author Report Share Posted September 16, 2010 (edited) if(!$_SESSION['logged_in'] || ($_SESSION['u_level'] != 4 && $_SESSION['u_level'] != 2)) if(!$_SESSION['logged_in'] or $_SESSION['u_level'] == 4 xor $_SESSION['u_level'] != 2) respektivi lasot kodu abi ir pareizi bet tomer atdzistu ka pareizak ir ka teu pec idejas ;) bet var izmantot gan tadu gan ari tadu :) Edited September 16, 2010 by Faks Quote Link to comment Share on other sites More sharing options...
Vhubuo Posted September 16, 2010 Report Share Posted September 16, 2010 Paldies Par Jusu Visu Laiku Izdomaju ka to uzrakstit izradijas diezgan pratigi :D seit bus piemers ! if(!$_SESSION['logged_in'] or $_SESSION['u_level'] == 4 xor $_SESSION['u_level'] != 2) Es laikam vel nevienu reizi neesmu redzejis biznesa produkcijasss koda tiešo xor izmantoanu. Ja tadu atstaj bez kometara ar rupigu paskaidrojumu, var droši sist pa rokam. 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.