Autor Zpráva
lear
Profil *
ahoj, jak mám udělat když třeba v indexu chci mít víc stránek? Myslím to tak když někdo klikne třeba na Domů tak odkaz bude index.php?stranka=domu a vtom nějaký text a když někdo klikne na kontakt tak index.php?stranka=kontakt a vtom nějaký text
Radek9
Profil
http://firstpage.profitux.cz/?page=web_bez_ramu
crea
Profil *
if($_GET["strana"] == "domu") echo "Domovská stránka (můžeš i includovat soubor s obsahem)";
elseif($_GET["strana"] == "kontakt") echo "Kontaktní údaje";
lear
Profil *
Radek9 nechápu
crea díky funguje ;)
lear
Profil *
ještě jestli se můžu zeptat,použil sem to na RS php fusion na mod staff_list tak když někdo klikne na vedeni tak se mu zobrazí ze skupiny daný uživatelé který jsou v tý skupině jenže když někdo klikne na vedení tak tam sou údaje 2x stejný a když kliknu na redaktoři tak to vypisuje dobře kod je:
<?php

/*-------------------------------------------------------+
| PHP-Fusion Content Management System
| Copyright (C) 2002 - 2008 Nick Jones
| http://www.php-fusion.co.uk/
+--------------------------------------------------------+
| Filename: staff_list.php
| Author: Qwertz
+--------------------------------------------------------+
| This program is released as free software under the
| Affero GPL license. You can redistribute it and/or
| modify it under the terms of this license which you
| can read by viewing the included agpl.txt or online
| at www.gnu.org/licenses/agpl.html. Removal of this
| copyright header is strictly prohibited without
| written permission from the original author(s).
+--------------------------------------------------------*/
require_once "maincore.php";
require_once THEMES."templates/header.php";
include LOCALE.LOCALESET."staff_list.php";
openside($locale['sl_400']);
echo "".$locale['sl_410']."";
closeside();
if($_GET["strana"] == "vedeni") {
$group_id = "1";
$result = dbquery("SELECT * FROM ".$db_prefix."users WHERE user_groups REGEXP('^\\\.{$group_id}$|\\\.{$group_id}\\\.|\\\.{$group_id}$') ORDER BY user_level DESC, user_name");
$rows = dbrows($result);
if ($rows != 0) {
$i = 0;

while ($data = dbarray($result)) {
$cell_color = ($i % 2 == 0 ? "tbl1" : "tbl2"); $i++;

openside("<a href='".BASEDIR."profile.php?lookup=".$data['user_id']."'>".$data['user_name']."</a>");
echo"<table cellpadding='0' cellspacing='0' width='100%'>
<tbody><tr>
<td class='tbl1' valign='top' width='33%'><strong>".$locale['sl_411']." </strong>";

if ($data['user_rname']) {
echo"<b></b>".$data['user_rname']."<b></b>";
}
else {
echo"<i>".$locale['sl_419']."</i>"; }

echo"</td>
<td class='tbl1' valign='top' width='33%'><strong>".$locale['sl_412']."</strong> ";
if ($data['user_age']) {
echo"<b></b>".$data['user_age']."<b></b>";
}
else {
echo"<i>".$locale['sl_419']."</i>"; }

echo"</td>
<td class='tbl1' valign='top' width='33%'><strong>".$locale['sl_413']." </strong>Vedení</td>
</tr>

</tbody></table>
<table cellpadding='0' cellspacing='0' width='100%'>
<tbody><tr>
<td rowspan='4' class='tbl1' valign='top' width='100'>
<a href='".BASEDIR."profile.php?lookup=".$data['user_id']."'><img src= '".BASEDIR."images/avatars/".$data['user_avatar']."' style='margin-right: 10px;' alt='' border='0'></a></td>
<td class='tbl1' valign='top'><strong>".$locale['sl_414']."</strong>
</td></tr><tr><td class='tbl1' valign='top'>";

if ($data['user_about']) {
echo "\n".nl2br(parseubb(parsesmileys($data['user_about']), "smiley|b|i|u||url|mail|color"));
}
else {
echo"<i>".$locale['sl_420']."</i>"; }

echo " </td>
</tr><tr><td class='tbl1' valign='top'><strong>".$locale['sl_418']."</strong></td>
</tr><tr><td class='tbl1' valign='top'>";

if ($data['user_duty']) {
echo "\n".nl2br(parseubb(parsesmileys($data['user_duty']), "b|i|u"));}
else {
echo"<i>".$locale['sl_421']."</i>"; }

echo"</td></tr><tr><td colspan='2' class='tbl1'>
<strong>".$locale['sl_415']." </strong>";

if ($data['user_email']) {
echo"<a href='mailto:".$data['user_email']."'>".$locale['sl_416']."</a>";
}
echo" | ";
echo"<a href='".BASEDIR."messages.php?msg_send=".$data['user_id']."'>".$locale['sl_417']."</a></td>
</tr></tbody></table>";
closeside();
}
} else {
echo "<center><br>".$locale['sl_422']."<br><br>\n</center>\n";
}
}

elseif($_GET["strana"] == "redaktori")
$group_id = "2";
$result = dbquery("SELECT * FROM ".$db_prefix."users WHERE user_groups REGEXP('^\\\.{$group_id}$|\\\.{$group_id}\\\.|\\\.{$group_id}$') ORDER BY user_level DESC, user_name");
$rows = dbrows($result);
if ($rows != 0) {
$i = 0;

while ($data = dbarray($result)) {
$cell_color = ($i % 2 == 0 ? "tbl1" : "tbl2"); $i++;

openside("<a href='".BASEDIR."profile.php?lookup=".$data['user_id']."'>".$data['user_name']."</a>");
echo"<table cellpadding='0' cellspacing='0' width='100%'>
<tbody><tr>
<td class='tbl1' valign='top' width='33%'><strong>".$locale['sl_411']." </strong>";

if ($data['user_rname']) {
echo"<b></b>".$data['user_rname']."<b></b>";
}
else {
echo"<i>".$locale['sl_419']."</i>"; }

echo"</td>
<td class='tbl1' valign='top' width='33%'><strong>".$locale['sl_412']."</strong> ";
if ($data['user_age']) {
echo"<b></b>".$data['user_age']."<b></b>";
}
else {
echo"<i>".$locale['sl_419']."</i>"; }

echo"</td>
<td class='tbl1' valign='top' width='33%'><strong>".$locale['sl_413']." </strong>Vedení</td>
</tr>

</tbody></table>
<table cellpadding='0' cellspacing='0' width='100%'>
<tbody><tr>
<td rowspan='4' class='tbl1' valign='top' width='100'>
<a href='".BASEDIR."profile.php?lookup=".$data['user_id']."'><img src= '".BASEDIR."images/avatars/".$data['user_avatar']."' style='margin-right: 10px;' alt='' border='0'></a></td>
<td class='tbl1' valign='top'><strong>".$locale['sl_414']."</strong>
</td></tr><tr><td class='tbl1' valign='top'>";

if ($data['user_about']) {
echo "\n".nl2br(parseubb(parsesmileys($data['user_about']), "smiley|b|i|u||url|mail|color"));
}
else {
echo"<i>".$locale['sl_420']."</i>"; }

echo " </td>
</tr><tr><td class='tbl1' valign='top'><strong>".$locale['sl_418']."</strong></td>
</tr><tr><td class='tbl1' valign='top'>";

if ($data['user_duty']) {
echo "\n".nl2br(parseubb(parsesmileys($data['user_duty']), "b|i|u"));}
else {
echo"<i>".$locale['sl_421']."</i>"; }

echo"</td></tr><tr><td colspan='2' class='tbl1'>
<strong>".$locale['sl_415']." </strong>";

if ($data['user_email']) {
echo"<a href='mailto:".$data['user_email']."'>".$locale['sl_416']."</a>";
}
echo" | ";
echo"<a href='".BASEDIR."messages.php?msg_send=".$data['user_id']."'>".$locale['sl_417']."</a></td>
</tr></tbody></table>";
closeside();
}
} else {
echo "<center><br>".
lear
Profil *
vyřešeno muzete lock
lear
Profil *
jen když někdo klikne na uvodni stranku tak mu to vypise
Notice: Undefined index: strana in /home/www/air-fox.eu/www/staff_list.php on line 21

Notice: Undefined index: strana in /home/www/air-fox.eu/www/staff_list.php on line 98

jak se tich chyb zbavit? a aby to treba samo vypsalo index?strana=domu
Sirius
Profil
Necetl jsem cely tvuj kod, ale ja to u sebe resil pres isset

if (isset($strana)) {
  if ($strana == "domu") {include domu.xxx;}
  elseif ($strana == "dalsi") {dalsi include;}
  else ($strana == "posledni") {posledni include;}
}
else {
  include domu.xxx;
}

Vaše odpověď

Mohlo by se hodit


Prosím používejte diakritiku a interpunkci.

Ochrana proti spamu. Napište prosím číslo dvě-sta čtyřicet-sedm:

0