Jump to content
php.lv forumi

<a href Kļūda


zintis8789

Recommended Posts

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 by zintis8789
Link to comment
Share on other sites

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 by briedis
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...