Jump to content
php.lv forumi

nesaprotu vienu fichu


matx

Recommended Posts

megjinashu izteikties skaidrak, saprotamak!

 

uztaisu lapu (tamp.php) ielieku vairakas tabulas katrai tabulai savu id pieshkjiru, ierakstu textus sava tabula savu! tad megjinu iet tamp.php?id=(id pieshkjirtais tabulai) atveras viss tamp.php , bet man vajag lai atveras tikai ta tabula kurai pieshkjiru id! es kko nepareizi izdariju- zinu, tik nezinu ko! kur jalieka tas id, vai ari to visu var panakt ar citu panjemienu?

 

Paldies!

Link to comment
Share on other sites

Vareji jau kodu paradit, kas tev neiet. Bet pec apraksta spriezhot tev butu jadara shadi:

 

if(!isset($_GET['id'])) 
{
//uzraksts kas paradas kad nav izvelets kuru tabulu radit
}
elseif($_GET['id'] == '1')
{
//1a tabula
}
else
{
// ja neeksiste tads 'id' paradam error message
}

Link to comment
Share on other sites

es php nerubiju, juus nesapratat manu domu! karoche uztaisu tabulu 1

<table id="$p2" width="200" border="1">
     <tr>
       <th scope="col">tabula1</th>
     </tr>
   </table>

tabulu2

<table id="$p2" width="200" border="1">
     <tr>
       <th scope="col">tabula2</th>
     </tr>
   </table>

tas viss ieksh tamp.php

 

raxtu linku: www.kkas.lv/tamp.php?id=p2 un gribu lai paradaas nevis abas tabulas bet tikai tabula kurai id ir p2... mosh taa nemaz nevar izdarit, tad varbut iesakat kaa to var izdariit!

Edited by matx
Link to comment
Share on other sites

Nu jaa ta ka tu to velies panakt nevar. Vienkarshi lieto manu variantu:

 

if(!isset($_GET['id']))
{
echo' <a href="'.$_SERVER['PHP_SELF'].'?id=1">1aa tabula</a><br />
<a href="'.$_SERVER['PHP_SELF'].'?id=1">2aa tabula</a>';
}
elseif($_GET['id'] == '1')
{
echo'<table width="200" border="1">
    <tr>
      <th scope="col">tabula1</th>
    </tr>
  </table>'; 
}
elseif($_GET['id'] == '2')
{
echo'<table width="200" border="1">
    <tr>
      <th scope="col">tabula2</th>
    </tr>
  </table>';
}
else
{
echo 'tada tabula neeksistee';
}

Link to comment
Share on other sites

nu es nesaprotu ko juus tur uzraxtijat, mosh uzraksti taa vienkarshak, lai es mosh kko saprastu ;) nu doma tada, uztaisit lidzigi ka ir te davikovs.eclub.lv, menuci pacholee... ir /?id=kkas un atveraas kkas... es velos kka taa

Link to comment
Share on other sites

nu es nesaprotu ko juus tur uzraxtijat, mosh uzraksti taa vienkarshak, lai es mosh kko saprastu ;) nu doma tada, uztaisit lidzigi ka ir te davikovs.eclub.lv, menuci pacholee... ir /?id=kkas un atveraas kkas... es velos kka taa
smiliez.de_2125.gifTur jau tā vienkārši sarakstīts.
Link to comment
Share on other sites

×
×
  • Create New...