vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   Switch Case Help (https://vborg.vbsupport.ru/showthread.php?t=49979)

Serge 03-11-2003 09:36 PM

Switch Case Help
 
Ok I'm having problems with a switch case I'm trying to run on a script I'm trying to program.

here is the entire script with all the html as well.

PHP Code:

    <html>
    <head>
    <title>Surrix Article Manager</title>
    </head>
    <body bgcolor="#273549">
    <basefont size=2 face=arial color=white>
    <br>
    <br>
    <br>
    <br>
    <br>
    <center><img src="cplogo.jpg"><br>
    <a href="index2.php?nav=addarticle">Add Article</a> | <a href="index2.php?nav=adduser">Add User</a></center>
    <br>
    <br>
    <br>

    <?php

    
switch ($nav)
    {
    case 
"addarticle":
    include (
"adda.htm" );
    break;

    case 
"adduser":
    include (
"addu.htm" );
    break;
    }

    
?>

When I click on the links it doesn't do anything when it should include adda.htm or addu.htm where i have it. I have no clue what is going wrong would someone please help.

Xenon 03-11-2003 09:40 PM

this will just work if register globals are ON in your php.ini
with php4.2.x it's off normally

Serge 03-11-2003 09:45 PM

ah that is probably my problem I will check the phpinfo files.....

and they are off

Another question though which is better having them off or on is it a risk worth taking?

Xenon 03-11-2003 09:49 PM

AFAIK it's not that risky, so you can turn it on.

but nevertheless you should try to write your scripts in a way so globals on isn't needed :)

Serge 03-11-2003 09:50 PM

ok thanks for the advice


All times are GMT. The time now is 11:42 AM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.02944 seconds
  • Memory Usage 1,716KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)bbcode_php_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (5)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete