Forum FAQForum FAQSearchSearch MemberlistMemberlist Forum ignore listForum ignore list RegisterRegister ProfileProfile Log in to check your private messagesLog in to check your private messages Log inLog in
navicgacija sa /index.php?cmd=

 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    mi3dot.org Forum Index -> Server-side
View previous topic :: View next topic  
Author Message
boby-s



Joined: 10 Apr 2004
Posts: 222
Location: Samobor< >Zagreb

PostPosted: 28.02.2005 22:26    Post subject: navicgacija sa /index.php?cmd= Add user to your forum ignore list Reply with quote

ovako.nepravim navigaciju sa :

prvi link > vijesti1 > index.php?cmd=vijesti1
drugi link > vijesti2 > index.php?cmd=vijesti2
Code:

<?

$cmd = $_GET['cmd'];

switch ($cmd) {
default:
case 'vijesti1':
 // pa sto ovdje ide
$vijesti=('$number = "5";
 if (!$category || !$ucat) { $category = "vijesti1"; }
 include("cute168/show_news.php");');
');
break;

case 'vijesti2':
 // pa sto ovdje ide
$vijesti=('$number = "5";
 if (!$category || !$ucat) { $category = "vijesti2"; }
 include("cute168/show_news.php");');
break;

}
?>



i želim da se kod iz $vijesti izvrši,[ tamo gdje ga postavim] ali se ne izvršava > kako to
Code:

<?
$vijesti;
?>


inače, ovo sve bi trebalo, iz $cmd-a izvuć podatak, ako je cmd Vijest1 onda je $vijesti [kod koji ispisuje sve vijesti iz podskupine vijesti1] //cutenews - aj fork...

ista stvar je i za vijest2
help, bilotko, ako tko zna... Embarassed
Back to top
View user's profile Send private message
che.UP
mi3.crew


Joined: 07 Sep 2003
Posts: 2320
Location: zagreb

PostPosted: 28.02.2005 23:35    Post subject: Add user to your forum ignore list Reply with quote

mislim da imas krivi pristup problemu. zasto jednostavno ne stavis taj switch/case tamo di ti treba (tam di imas $vijesti)?

_________________
UP | TypeTester | Accommodations App
Meni u Firefox-u ne radi AJAX
Back to top
View user's profile Send private message Visit poster's website
boby-s



Joined: 10 Apr 2004
Posts: 222
Location: Samobor< >Zagreb

PostPosted: 01.03.2005 16:01    Post subject: Add user to your forum ignore list Reply with quote

tog sam se i ja sjetio...probat cu...
Back to top
View user's profile Send private message
boby-s



Joined: 10 Apr 2004
Posts: 222
Location: Samobor< >Zagreb

PostPosted: 01.03.2005 18:21    Post subject: Add user to your forum ignore list Reply with quote

Code:
<?php
      //traži varijablu cmd
        $cmd = $_GET['cmd'];

      //ako je cmd 0...      
       switch ($cmd) {
       default:

        //ako je cmd  0...     
          case '0':
      // onda inkluda zadnjih 5 vijesti
         echo ('<?
        $number = "5"; include("cute168/show_news.php"); ?>');
        break;
     
     //ako je cms ljubav...
        case 'ljubav':
     // onda ispisuje zadnjih 5 vijesti iz kategorije ljubav
        echo('<? $number = "5";
        if (!$category || !$ucat) { $category = "ljubav"; }
        include("cute168/show_news.php");
        ?>');
       break;

     //ako je cmd skola...
        case 'skola':
    //onda ispisuje zadnjih 5 vijesti iz kategorije skola
      echo ('<?
     $number = "5";
     if (!$category || !$ucat) { $category = "skola"; }
     include("cute168/show_news.php");
     ?>');
     break;
?>


i ispisuje error

Parse error: parse error, unexpected $ in /home/d2o/public_html/cms/index.php on line 344

a linija 344 u index.php je
Code:
</body>
</html>
Back to top
View user's profile Send private message
che.UP
mi3.crew


Joined: 07 Sep 2003
Posts: 2320
Location: zagreb

PostPosted: 01.03.2005 18:41    Post subject: Add user to your forum ignore list Reply with quote

probaj s ovim...

Code:
<?php

     //traži varijablu cmd
    $cmd = $_GET['cmd'];
    switch ($cmd) {
        default:
        //ako je cmd  0...     
         case '0':
         // onda inkluda zadnjih 5 vijesti
              $number = "5";
              include("cute168/show_news.php");
              break;
     
    //ako je cms ljubav...
        case 'ljubav':
        // onda ispisuje zadnjih 5 vijesti iz kategorije ljubav
              $number = "5";
              if (!$category || !$ucat) { $category = "ljubav"; }
              include("cute168/show_news.php");
              break;

        //ako je cmd skola...
        case 'skola':
        //onda ispisuje zadnjih 5 vijesti iz kategorije skola
     
                $number = "5";
                if (!$category || !$ucat) { $category = "skola"; }
                include("cute168/show_news.php");
                break;

}
?>

_________________
UP | TypeTester | Accommodations App
Meni u Firefox-u ne radi AJAX
Back to top
View user's profile Send private message Visit poster's website
boby-s



Joined: 10 Apr 2004
Posts: 222
Location: Samobor< >Zagreb

PostPosted: 01.03.2005 21:40    Post subject: Add user to your forum ignore list Reply with quote

ei LiK, pa ti si lud Shocked Shocked

Sve raDI, hVALA!!!
Back to top
View user's profile Send private message
retro_one



Joined: 16 Sep 2003
Posts: 880
Location: DUBRAVA.

PostPosted: 01.03.2005 22:48    Post subject: Add user to your forum ignore list Reply with quote

zasto multiple includeovi...kad bi mogao bubnuti include nakon switcha posto je isti file u igri

_________________
Just your average eccentric programmer.
Back to top
View user's profile Send private message
liban0n



Joined: 10 Feb 2004
Posts: 128
Location: Dubrovnik, Zagreb

PostPosted: 02.03.2005 09:50    Post subject: Add user to your forum ignore list Reply with quote

lijepo primjeceno ... ali to u biti i nije greska nego samo visak vremena i tipkanja.

_________________
mount -t swap /dev/brain /mnt/head
look'n for a job
Back to top
View user's profile Send private message Visit poster's website
che.UP
mi3.crew


Joined: 07 Sep 2003
Posts: 2320
Location: zagreb

PostPosted: 02.03.2005 12:09    Post subject: Add user to your forum ignore list Reply with quote

retro_one wrote:
zasto multiple includeovi...kad bi mogao bubnuti include nakon switcha posto je isti file u igri


istina, 'zvinte, ja sam samo quick fixao da mu proradi, tek kasnije sam skuzio al nisam stigo prepravljat :)

_________________
UP | TypeTester | Accommodations App
Meni u Firefox-u ne radi AJAX
Back to top
View user's profile Send private message Visit poster's website
liban0n



Joined: 10 Feb 2004
Posts: 128
Location: Dubrovnik, Zagreb

PostPosted: 02.03.2005 13:07    Post subject: Add user to your forum ignore list Reply with quote

nitko te nije ni okrivio ? Wink

_________________
mount -t swap /dev/brain /mnt/head
look'n for a job
Back to top
View user's profile Send private message Visit poster's website
retro_one



Joined: 16 Sep 2003
Posts: 880
Location: DUBRAVA.

PostPosted: 02.03.2005 17:18    Post subject: Add user to your forum ignore list Reply with quote

che.UP wrote:
retro_one wrote:
zasto multiple includeovi...kad bi mogao bubnuti include nakon switcha posto je isti file u igri


istina, 'zvinte, ja sam samo quick fixao da mu proradi, tek kasnije sam skuzio al nisam stigo prepravljat Smile


c c c c Laughing

_________________
Just your average eccentric programmer.
Back to top
View user's profile Send private message
boby-s



Joined: 10 Apr 2004
Posts: 222
Location: Samobor< >Zagreb

PostPosted: 02.03.2005 22:36    Post subject: Add user to your forum ignore list Reply with quote

Quote:
zasto multiple includeovi...kad bi mogao bubnuti include nakon switcha posto je isti file u igri

Quote:
istina, 'zvinte, ja sam samo quick fixao da mu proradi, tek kasnije sam skuzio al nisam stigo prepravljat Smile


a jel se smije znat kako bi drugačije moglo.

[ovo radi, ali me zanima]
Back to top
View user's profile Send private message
che.UP
mi3.crew


Joined: 07 Sep 2003
Posts: 2320
Location: zagreb

PostPosted: 03.03.2005 11:37    Post subject: Add user to your forum ignore list Reply with quote

Code:
              include("cute168/show_news.php");

pa samo ovu liniju maknes iz caseova i stavis su iza switcha. isto mozes napraviti i sa varijablom $number ako uvijek imas isti broj newsa koji se prikazuju....

_________________
UP | TypeTester | Accommodations App
Meni u Firefox-u ne radi AJAX
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    mi3dot.org Forum Index -> Server-side All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group