Jump to content
php.lv forumi

problema ar case'iem


Devils666

Recommended Posts

problēma ar šo kodu:

if(isset($_GET['lapa']))
{
switch($_GET['lapa'])
{
	case 'forums':
               echo "seit bus forums";
	break;
}
}
else
{
       echo "čau";
}

 

viss ir skaisti līdz bridim, kad lietotājs uzraksta nevis index.php vai index.php?lapa=forums,

bet gan piem index.php?lapa=9jafowef

kā varetu uztaisīt, lai parāditos, ka lapa nav atrasta vai kaut ko tadu?

 

mēgināju

else if($_GET['p'] != 'forums'){
                echo "sūkā ledu";
}

 

bet nez kapēc neiet

Edited by Devils666
Link to comment
Share on other sites

else if($_GET['p'] != 'forums'){
                echo "sūkā ledu";
}

 

"Sūkā ledu!" :D :D

 

Problēma:

 

Man neiet šāds risinājums...

 

HTACCESS:

ErrorDocument 404 /error.php

 

Lapa "error.php" ir izveidota.

 

Piemēram, ieejot "127.0.0.1/d" neveras vaļā "error.php", bet gan standarta 404 lapa.

 

Viss "griežās uz" XAMPP. Pārrestartēju XAMPP. :) Hmm...

Edited by daGrevis
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...