zintis8789 Posted November 20, 2009 Report Share Posted November 20, 2009 (edited) Man ir kods: <? if($_GET[order]==GP || $_GET[cik]==ASC){ $d=DESC; } if($_GET['order']==GP || $_GET[cik]==DESC){ $d=ASC; } ?> Es uzspiežu uz linka : manaadrese.lv/index.php?order=GP&cik=ASC Man parādās atkal tas pats links: manaadrese.lv/index.php?order=GP&cik=ASC Bet man vajag lai parāditos manaadrese.lv/index.php?order=GP&cik=DESC Edited November 20, 2009 by zintis8789 Quote Link to comment Share on other sites More sharing options...
briedis Posted November 20, 2009 Report Share Posted November 20, 2009 Kur pēdiņas? if($_POST['kautkas'] == "STRINGS") $mainiigais = "STRINGS"; Ja tu neliec pēdiņas, tad tiek meklēta konstante STRINGS... Quote Link to comment Share on other sites More sharing options...
zintis8789 Posted November 20, 2009 Author Report Share Posted November 20, 2009 Man visulaiku bija pediņas bet tikuntaa negāja! Quote Link to comment Share on other sites More sharing options...
briedis Posted November 20, 2009 Report Share Posted November 20, 2009 (edited) Ok, papētīju tavu "loģiku" <? if($_GET[order]==GP || $_GET[cik]==ASC){ $d=DESC; } if($_GET['order']==GP || $_GET[cik]==DESC){ $d=ASC; } ?> Ko es redzu - Ja ir ASC, tad uzstādam DESC. Sēko nākamā pārbaude. Ja ir DESC (ko tikko uzstādījām), tad uzstādam atkal ASC :) dari tā if(nosaciijums){ }elseif(vai cits nosaciijums){ } Edited November 20, 2009 by briedis Quote Link to comment Share on other sites More sharing options...
zintis8789 Posted November 20, 2009 Author Report Share Posted November 20, 2009 Problēma atrisināta! Quote Link to comment Share on other sites More sharing options...
indoom Posted November 20, 2009 Report Share Posted November 20, 2009 nu vispār || vietā vajag && abos ifos bet var jau arī $d = isset($_GET['order'],$_GET['cik']) && $_GET['order'] === 'GP' && $_GET['cik'] === 'ASC' ? 'DESC' : 'ASC'; 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.