Announcement

Collapse
No announcement yet.

Variable problem

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Variable problem

    does anyone know why I'm having problem with the variable.

    I don't have a problem with them on a linux servers. I just started recently working on a NT server and I'm having problem with my varibles.

    Let's say if I put the following code on the NT server I'll get an "Undefined variable" error

    PHP Code:
     if($sport=="baseball"){} 
    for some reason I keep getting an error on the NT server. Is that something that has to be with the installation?

  • #2
    It means that $sport has not been defined anywhere earlier in the script.

    This is normal behaviour and the warning PHP generates is on by default iirc.

    Comment


    • #3
      I didn't get this error before. What about if you are going to use the variable from a form?

      Comment


      • #4
        use $_REQUEST['variable'] so your script remains safe to use with register_globals off.

        To supress errors you can use the error_reporting function, you will find details of it at www.php.net/error_reporting

        Comment

        widgetinstance 262 (Related Topics) skipped due to lack of content & hide_module_if_empty option.
        Working...
        X