_Matwey_ Posted May 16, 2008 Report Share Posted May 16, 2008 (edited) Sveiki! Man ir problēmas ar title un description nomaiņu atkarībā kura lapa ir ielādēta! man ir menu ir piecas sadaļas (sākums, par kompāniju, produkcija utt.) un kkā ar if (vai kāds jūsu variants) nomainās title un description! piemēram kkas tamlīdzīgs, nezinu ar ko lai sāk, jo nevaru likt javascript un neatradu tieši man saprotamu variantu googlē meklēju šadi-"change title php tutorial" <? if ($page='index.php'){ $title='index'; }?> <title><?php echo "$title"?></title> Edited May 16, 2008 by _Matwey_ Link to comment Share on other sites More sharing options...
andrisp Posted May 16, 2008 Report Share Posted May 16, 2008 Nu bet lukur tu jau pats risinājumu iekopēji. Kas nav skaidrs ? Link to comment Share on other sites More sharing options...
_Matwey_ Posted May 16, 2008 Author Report Share Posted May 16, 2008 Nu bet lukur tu jau pats risinājumu iekopēji. Kas nav skaidrs ? nesrādā, ja ir if ($page='index.php'){ $title='index'; } if ($page='galerija.php'){ $title='galerija'; } tad visur rādās pēdājais title, šajā gadījumā - galerija Link to comment Share on other sites More sharing options...
march Posted May 16, 2008 Report Share Posted May 16, 2008 Salīdzināšanā jāizmanto == , nevis parastais = Link to comment Share on other sites More sharing options...
_Matwey_ Posted May 16, 2008 Author Report Share Posted May 16, 2008 Salīdzināšanā jāizmanto == , nevis parastais = nestrādā tāpat! Link to comment Share on other sites More sharing options...
Val Posted May 16, 2008 Report Share Posted May 16, 2008 salīdzināšana ir iekavās, nevis nākamā rinda aiz tām Link to comment Share on other sites More sharing options...
_Matwey_ Posted May 16, 2008 Author Report Share Posted May 16, 2008 salīdzināšana ir iekavās, nevis nākamā rinda aiz tām ja nav grūti-uzraksti lūdzu kā tam jāizskatās, savād aizies visa diena līdz nonākšu līdz vajadzīgajam rezultatam! Link to comment Share on other sites More sharing options...
Val Posted May 16, 2008 Report Share Posted May 16, 2008 (edited) $title = 'nokluseetaais title'; if ($page=='index.php'){ $title='index'; } elseif ($page=='galerija.php'){ $title='galerija'; }; varētu jau piedāvāt ar switch to visu rakstīt, bet nu labi... Edited May 16, 2008 by Val Link to comment Share on other sites More sharing options...
RaaapuLis Posted May 16, 2008 Report Share Posted May 16, 2008 (edited) peec } ieliec semikolu (laikam taa) $title = 'nokluseetaais title'; if ($page=='index.php'){ $title='index'; }; elseif ($page='galerija.php'){ $title='galerija'; }; Iet vai neiet? Edited May 16, 2008 by RaaapuLis Link to comment Share on other sites More sharing options...
Val Posted May 16, 2008 Report Share Posted May 16, 2008 labrīt. Link to comment Share on other sites More sharing options...
RaaapuLis Posted May 16, 2008 Report Share Posted May 16, 2008 kas? kaads labriit? Link to comment Share on other sites More sharing options...
_Matwey_ Posted May 16, 2008 Author Report Share Posted May 16, 2008 peec } ieliec semikolu (laikam taa) $title = 'nokluseetaais title'; if ($page=='index.php'){ $title='index'; }; elseif ($page='galerija.php'){ $title='galerija'; }; Iet vai neiet? diemžēl visur rādās galerija :( kkā jānodefinā kas ir $page, vai php saprot to ka $page ir ielādētā lapa? Link to comment Share on other sites More sharing options...
Val Posted May 16, 2008 Report Share Posted May 16, 2008 varbūt parādi index.php saturu? Link to comment Share on other sites More sharing options...
_Matwey_ Posted May 16, 2008 Author Report Share Posted May 16, 2008 (edited) varbūt parādi index.php saturu? no probs begin.php <?php $title = 'nokluseetaais title'; if ($page=='index.php'){ $title='index'; } elseif ($page='galerija.php'){ $title='galerija'; }; ?> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <meta name="description" content=""> <meta name="keywords" content=""> <LINK REL="SHORTCUT ICON" HREF="logo.ico"> <title> <?php echo "$title" ?></title> <link href="style.css" rel="stylesheet" type="text/css" /> <style type="text/css"> <!-- BODY { } --> </style> </head> <body bgcolor="#ebebeb"> <table cellpadding="0" cellspacing="0" id="wra" width="100%" border=0> <tr> <td class="left"> </td> <td class="table"> <div class="logo"></div> <div class="par_mums"><table align="center"><tr><td align="center" valign="middle" width="135px" height="34px"> <a class="button" onmouseover="this.className='buttonON'" onmouseout="this.className='button'" href="index.php">par mums</a></td></tr></table></div> <div class="par_mebelem"><table align="center"><tr><td align="center" valign="middle" width="135px" height="34px"> <a class="button" onmouseover="this.className='buttonON'" onmouseout="this.className='button'" href="par_mebelem.php">par mebelēm</a></td></tr></table></div> <div class="gelerija"><table align="center"><tr><td align="center" valign="middle" width="135px" height="34px"> <a class="button" onmouseover="this.className='buttonON'" onmouseout="this.className='button'" href="galerija.php">galerija</a></td></tr></table></div> <div class="kontakti"><table align="center"><tr><td align="center" valign="middle" width="135px" height="34px"> <a class="button" onmouseover="this.className='buttonON'" onmouseout="this.className='button'" href="kontakti.php">kontakti</a></td></tr></table></div> <div class="atsauksmem"><table align="center"><tr><td align="center" valign="middle" width="135px" height="34px"> <a class="button" onmouseover="this.className='buttonON'" onmouseout="this.className='button'" href="guestbook.php">atsauksmēm</a></td></tr></table></div> index.php <? include('begin.php'); ?> <div class="virsraksts"><table><tr><td class="vtext">Par mums </td> blablabla </td> <? include('bottom.php'); ?> Edited May 16, 2008 by _Matwey_ Link to comment Share on other sites More sharing options...
p4F Posted May 16, 2008 Report Share Posted May 16, 2008 kas ir $page? izdari echo $page; Link to comment Share on other sites More sharing options...
Recommended Posts