iall Posted September 23, 2007 Report Share Posted September 23, 2007 Sakiet lūdzu ,kapēc man nestrādā šis džamp skripts ? <?PHP $id = $_GET['id']; if ($id == "") $link = "http://www.auss.lv/"; if ($id == "01") $link = "http://www.roka.lv/"; if ($id == "02") $link = "http://www.galva.org/"; ?> Link to comment Share on other sites More sharing options...
Val Posted September 23, 2007 Report Share Posted September 23, 2007 biku kods netīrs, bet ja pareizi sapratu, ko tu gribi, tad pēc IF'iem ieliec header('Location: '.$link); Link to comment Share on other sites More sharing options...
iall Posted September 23, 2007 Author Report Share Posted September 23, 2007 Tagad viss rukā!Senks :D Link to comment Share on other sites More sharing options...
Kavacky Posted September 23, 2007 Report Share Posted September 23, 2007 (edited) Varbūt aizmirsi datoru ieslēgt, un tāpēc nestrādā? Ja nepiesienas tam, ka tas ir tizli sarakstīts, tad viss strādā. Edit: ā, es padomāju, ka jump daļa ir kaut kur citur jārealizē pēc tam. Ups. Edited September 23, 2007 by Kavacky Link to comment Share on other sites More sharing options...
Vebers Posted September 23, 2007 Report Share Posted September 23, 2007 Pareizāk gan būtu rakstīt ar else if... Link to comment Share on other sites More sharing options...
andrisp Posted September 23, 2007 Report Share Posted September 23, 2007 Labāk būtu to visu taisīt ar masīvu: $links = array( '01' => 'links1', '02' => 'link2' // utt ) Un tad: if (isset($_GET['id']) && isset($links[$_GET['id']])) { $link = $links[$_GET['id']]; } Link to comment Share on other sites More sharing options...
Kavacky Posted September 24, 2007 Report Share Posted September 24, 2007 Un nahren vispār šajā gadījumā vajag kā stringu "01", "02", ... ? Vesels skaitlis strādās gana labi. Link to comment Share on other sites More sharing options...
Recommended Posts