logo-dw

Go Back   Dreamweaver Club Forums > Hand Coders Forum > PHP
Register FAQ Members List Search Today's Posts Mark Forums Read

Reply
 
Thread Tools Display Modes
Old 11-27-2013, 02:16 PM   #1
ardi258
 
Join Date: Nov 2013
Posts: 1
Default Error PHP SWITCH CASE

guys help for this script :

opsi not function, I don't know where the mistake.

PHP Code:
<?php 
        
if($status=="Kabiro" && $opsi=="")
        {
            include
"home/home_kabiro.php";
         }
        else if(
$status=="Staff" && $opsi=="")
        { 
            include
"home/home_staff.php";
        }
     
?>
     
    <?php
        $opsi 
= ("Number");
        switch(
$opsi){    
            case 
'01a' :
                
$include = ("pengguna.php");
                break;
            case 
'02a':
                
$include = ("dokumen.php");
                break;
            case 
'03a':
                
$include = ("pegawai.php");
                break;
            case 
'04a':
                
$include = ("log.php");
                break;
            case 
'05a':
                
$include = ("kabiro_dokumen.php");
                break;
            case 
'06a':
                
$include = ("disposisi_keluar.php");
                break;
            case 
'07a':
                
$include = ("disposisi.php");
                break;
            case 
'08a':
                
$include = ("disposisi_masuk.php");
                break;
            case 
'09a':
                
$include = ("profile.php");
                break;
            case 
'10a':
                
$include = ("laporan.php");
                break;
            case 
'11a':
                
$include = ("laporan_keluar.php");
                break;
            case 
'12a':
                
$include = ("laporan_masuk.php");
                break;
                }
    
?>
ardi258 is offline   Reply With Quote
Old 11-28-2013, 12:51 AM   #2
edbr
edbr's Avatar
 
Join Date: Aug 2005
Location: Bali
Posts: 11,175
Default

so what is happening? not sure what you are trying to do here. you declare $opsi as " Number" then the switch looks at other options . what if you set a default?
__________________
If you're happy and you know it shake your meds!
different style links examples

Flight / Hotel search
Free script download
Bali Villas
edbr is offline   Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 09:13 AM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2017, vBulletin Solutions, Inc.
Copyright 2006 DreamweaverClub.com