bumbieriic Posted February 13, 2005 Report Share Posted February 13, 2005 kā lai nodefinē variable (piem. to pašu $id) , lai lapa beidz rādīt undefined variable :( Link to comment Share on other sites More sharing options...
bubu Posted February 13, 2005 Report Share Posted February 13, 2005 Piešķir kādu sākuma vērtību, piemēram: $id = 0; Link to comment Share on other sites More sharing options...
bumbieriic Posted February 13, 2005 Author Report Share Posted February 13, 2005 tā jau mēģināju, a tad rāda undefined index Link to comment Share on other sites More sharing options...
bubu Posted February 13, 2005 Report Share Posted February 13, 2005 Neticu, kautko tu te mānies! Parādi kodu! Link to comment Share on other sites More sharing options...
bumbieriic Posted February 13, 2005 Author Report Share Posted February 13, 2005 (edited) if($_GET['id']=="kautkas"){ include("sazinkas.php"); kaut kur jau ir tā vaina :unsure: Edited February 13, 2005 by bumbieriic Link to comment Share on other sites More sharing options...
justus Posted February 13, 2005 Report Share Posted February 13, 2005 bumbieriic apskaties savus personal mesages. Link to comment Share on other sites More sharing options...
bubu Posted February 13, 2005 Report Share Posted February 13, 2005 (edited) if($_GET['id']=="kautkas"){ include("sazinkas.php"); kaut kur jau ir tā vaina :unsure: 13676[/snapback] Te jau nav nekāds vienkāršs mainīgais $id!! Te ir masīva $_GET elements 'id'! Lai to pārbaudītu uz eksistenci, tad jārdara šādi: if (isset($_GET['id']) { // pārbaudam vai vispār ir 'id' elements _GET masīvā if ($_GET['id']=="kautkas") { // ja ir include("sazinkas.php"); } } else { // ja nav 'id' elementa // te kautko darām vai nedarām, ja nav vispār padots 'id' mainīgais caur GET pieprasījumu } Edited February 13, 2005 by bubu Link to comment Share on other sites More sharing options...
Venom Posted February 14, 2005 Report Share Posted February 14, 2005 NB: bumbieriic, 1 brīdinājums Link to comment Share on other sites More sharing options...
bumbieriic Posted February 14, 2005 Author Report Share Posted February 14, 2005 NB: bumbieriic, 1 brīdinājums 13690[/snapback] :blink: par ko? Link to comment Share on other sites More sharing options...
Venom Posted February 14, 2005 Report Share Posted February 14, 2005 par trīskāršu līdzīgu tematu Link to comment Share on other sites More sharing options...
bumbieriic Posted February 14, 2005 Author Report Share Posted February 14, 2005 (edited) 13676[/snapback] Te jau nav nekāds vienkāršs mainīgais $id!! Te ir masīva $_GET elements 'id'! Lai to pārbaudītu uz eksistenci, tad jārdara šādi: if (isset($_GET['id']) { // pārbaudam vai vispār ir 'id' elements _GET masīvā if ($_GET['id']=="kautkas") { // ja ir include("sazinkas.php"); } } else { // ja nav 'id' elementa // te kautko darām vai nedarām, ja nav vispār padots 'id' mainīgais caur GET pieprasījumu } 13681[/snapback] tai kodā nav kaut kas riktīgi visu laiku rāda, ka { nav riktīgs, mēģināju, kaut ko izlabot, bet kaut kā negrib pielekt -_- Edited February 14, 2005 by bumbieriic Link to comment Share on other sites More sharing options...
bubu Posted February 14, 2005 Report Share Posted February 14, 2005 Nu bāc, piemirsās iekava aiz isset() fjas, to tik grūti pamanīt? Pirmajai rindiņai jābūt šādai: if (isset($_GET['id'])) { Vajag mācēt arī lasīt kļūdu paziņojumus starp citu.. Link to comment Share on other sites More sharing options...
bumbieriic Posted February 14, 2005 Author Report Share Posted February 14, 2005 Nu bāc, piemirsās iekava aiz isset() fjas, to tik grūti pamanīt? Pirmajai rindiņai jābūt šādai:if (isset($_GET['id'])) { Vajag mācēt arī lasīt kļūdu paziņojumus starp citu.. 13703[/snapback] :) upss mana vaina Link to comment Share on other sites More sharing options...
Recommended Posts