Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> Problem z funkcja if oraz $_GET
CanoR
post
Post #1





Grupa: Zarejestrowani
Postów: 38
Pomógł: 0
Dołączył: 3.04.2009

Ostrzeżenie: (0%)
-----


Witam mam problem z funkcja IF oraz z metoda $_GET...
chce osiagnac efekt zaawansowanej strony PHP lecz zatrzymalem sie w pewnym miejscu
oto kod : Kod:
<?php

if(!isset($_GET["spells"])){
echo "<span class='orange'><a href='?spells=1.1'>Arcane</a><br />
<a href='?spells=1.2'>Fire</a><br />
<a href='?spells=1.3'>Frost</a></span><br />";
$wynik1=mysql_query("select * from news ORDER BY `news_data` DESC");
while($rekord=mysql_fetch_array($wynik1)){
$nadawca=mysql_fetch_array(mysql_query("select user_login from users where user_id=".$rekord["news_autor"]));
echo "<div id='news'>
<div class='head'><a href='?news=".$rekord["news_id"]."'><span class='title'>".$rekord["news_temat"]."</span></a><br />
<span class='text'>".$nadawca["user_login"].", ".$rekord["news_data"]."</span></div><br />
".$rekord["news_tresc"]."<br />
</div>";
}
}
else if($_GET["spells"] == 1.1){
$id=intval($_GET["spells"] == 1.1);
$wynik=mysql_query("select * from spells_mag_arcane ORDER BY `level` ASC");
}
else if($_GET["spells"] == 1.2){
$id=intval($_GET["spells"] == 1.2);
$wynik=mysql_query("select * from spells_mag_fire ORDER BY `level` ASC");
}
else if($_GET["spells"] == 1.3){
$id=intval($_GET["spells"] == 1.3);
$wynik=mysql_query("select * from spells_mag_frost ORDER BY `level` ASC");
}
if(isset($_GET["spells"])){
echo "<table>
<tr>
<td width=3%>Ikona</td>
<td width=50%>Nazwa</td>
<td width=5%>Level</td>
<td width=5%>Szkoła</td>
<td width=5%>Reagenty</td>
<td width=5%>Otrzymywanie</td>
<td width=5%>Skill</td>
</tr>";
if(!mysql_num_rows($wynik))echo "<tr><td colspan=4 style='text-align:center'>Nie znaleziono żadnych zaklęć w tym dziale!</td></tr>";
while($rekord=mysql_fetch_array($wynik)){
echo "<tr>
<td><a href='?spell=".$rekord["id"]."' onmouseover=".$rekord["span"]."ShowTT ('".$rekord["id"]."')".$rekord["span"]." onmouseout=".$rekord["span"]."HideTT()".$rekord["span"]."><span class='".$rekord["color"]."'><img src='".$rekord["ikona"]."'></span></a></td>
<td><a href='?spell=".$rekord["id"]."' onmouseover=".$rekord["span"]."ShowTT ('".$rekord["id"]."')".$rekord["span"]." onmouseout=".$rekord["span"]."HideTT()".$rekord["span"]."><span class='".$rekord["color"]."'>".$rekord["nazwa"]."</span></a></td>
<td>".$rekord["level"]."</td>
<td>".$rekord["szkola"]."</td>
<td>".$rekord["reagenty"]."</td>
<td>".$rekord["otrzymywanie"]."</td>
<td>".$rekord["skill"]."</td></tr>";
}
echo "</table>";
}

?>




chodzi mi oto jak mamy Kod:
if(!isset($_GET["spells"])){

czy niedaloby sie zrobic czegos aby w jednej instrukcji, warunku dodac jeszcze inne $_GET czyli cos takiego : Kod:
if(!isset($_GET["spells"]) or ($_GET["news"])){

(IMG:http://forum.php.pl/style_emoticons/default/questionmark.gif) potrzebne mi to bo chce cala strone oprzec o jedna index.php w ktorej beda wszystkie podstrony...

prosze o pomoc i z gory wielkie dzieki

CanoR
Go to the top of the page
+Quote Post

Posty w temacie
- CanoR   Problem z funkcja if oraz $_GET   3.04.2009, 14:15:18
- - Spawnm   lepsze empty: [PHP] pobierz, plaintext <?phpif...   3.04.2009, 14:20:33
- - CanoR   Ale czy to zadziala w moim przypadku ?   3.04.2009, 14:22:14
- - piotrooo89   CytatAle czy to zadziala w moim przypadku ? spraw...   3.04.2009, 14:23:42
- - CanoR   Tamta funkcja dziala ale mam problem z : if(isset(...   3.04.2009, 14:32:10
|- - piotrooo89   Cytat(CanoR @ 3.04.2009, 15:32:10 ) t...   3.04.2009, 14:38:25
|- - CanoR   Cytat(piotrooo89 @ 3.04.2009, 15:38:2...   3.04.2009, 14:46:21
- - tanwel_programmer   RE: Problem z funkcja if oraz $_GET   3.04.2009, 14:35:24
- - CanoR   Chce przerobic if(isset($_GET["spells...   3.04.2009, 14:38:21
|- - tanwel_programmer   Cytat(CanoR @ 3.04.2009, 15:38:21 ) C...   3.04.2009, 14:42:21
- - Spawnm   co nie działa ? daj kod w normalny bbcode , łamies...   3.04.2009, 14:48:23
- - piotrooo89   CytatSprawdzilem ten sposob i musze z przykroscia ...   3.04.2009, 14:48:53
- - CanoR   Dobra zaczne od poczatku teraz dokladniej mam sob...   3.04.2009, 14:55:54
|- - tanwel_programmer   Wrzóć wszystko na swicha'a i twój problem znik...   3.04.2009, 15:09:50
- - CanoR   Duzo mi to nie mowi ale ok moze cos wymysle dziek...   3.04.2009, 15:11:35
- - ikssde   Chodziło mu o : [PHP] pobierz, plaintext <?php...   3.04.2009, 15:14:44
- - CanoR   wiem ze mu oto chodzilo ale nie znam tego .... wla...   3.04.2009, 15:57:46
|- - tanwel_programmer   Cytat(CanoR @ 3.04.2009, 16:57:46 ) w...   3.04.2009, 16:09:22
- - CanoR   OK dzieki nadal nie mam wszystkiego do mojej stron...   3.04.2009, 17:45:27


Reply to this topicStart new topic
2 Użytkowników czyta ten temat (2 Gości i 0 Anonimowych użytkowników)
0 Zarejestrowanych:

 



RSS Aktualny czas: 23.08.2025 - 03:41