Undefined variable passing vars locally via URL

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Bob Bruyn

    Undefined variable passing vars locally via URL

    I've recently installed Apache 2 and php 5.2 on my WIndows XP
    machine. Everything is up and running.

    I'm passing some vars via the URL. It works fine online:


    This is the code:
    <?php echo $folder; ?>
    <?php echo $navColor; ?>

    The problem is that when I test it locally I get an error that the
    variable in undefined.
    Notice: Undefined variable: folder in F:\WEBSERVER\Ap ache2\htdocs\so nja
    \test.php on line 14
    Notice: Undefined variable: folder in F:\WEBSERVER\Ap ache2\htdocs\so nja
    \test.php on line 15
    Notice: Undefined variable: navColor in F:\WEBSERVER\Ap ache2\htdocs
    \sonja\test.php on line 32

    Can someone please help me out. Is there something wrong with my local
    php configuration?

    PS. You'll notice the Hello World at the top. That does work locally.
    (if that's any help)



    --


    *************** ****

    Bob Bruyn
    Torus Design
    Argonautenweg 45
    3054 RP Rotterdam
    010-4184349



  • Bob Bruyn

    #2
    Re: Undefined variable passing vars locally via URL

    I have it already:

    <?php echo $_GET['folder']; ?>

    instead of

    ("<?php echo $folder; ?>


    --


    *************** ****

    Bob Bruyn
    Torus Design
    Argonautenweg 45
    3054 RP Rotterdam
    010-4184349

    "Bob Bruyn" <bob@torusdesig n.nlwrote in message
    news:7ulni.996$ Rv4.592@amstwis t00...
    I've recently installed Apache 2 and php 5.2 on my WIndows XP
    machine. Everything is up and running.
    >
    I'm passing some vars via the URL. It works fine online:

    >
    This is the code:
    <?php echo $folder; ?>
    <?php echo $navColor; ?>
    >
    The problem is that when I test it locally I get an error that the
    variable in undefined.
    Notice: Undefined variable: folder in F:\WEBSERVER\Ap ache2\htdocs\so nja
    \test.php on line 14
    Notice: Undefined variable: folder in F:\WEBSERVER\Ap ache2\htdocs\so nja
    \test.php on line 15
    Notice: Undefined variable: navColor in F:\WEBSERVER\Ap ache2\htdocs
    \sonja\test.php on line 32
    >
    Can someone please help me out. Is there something wrong with my local
    php configuration?
    >
    PS. You'll notice the Hello World at the top. That does work locally.
    (if that's any help)
    >
    >
    >
    --
    >
    >
    *************** ****
    >
    Bob Bruyn
    Torus Design
    Argonautenweg 45
    3054 RP Rotterdam
    010-4184349

    >

    Comment

    • amygdala

      #3
      Re: Undefined variable passing vars locally via URL


      "Bob Bruyn" <bob@torusdesig n.nlschreef in bericht
      news:7ulni.996$ Rv4.592@amstwis t00...
      I've recently installed Apache 2 and php 5.2 on my WIndows XP
      machine. Everything is up and running.
      >
      I'm passing some vars via the URL. It works fine online:

      >
      This is the code:
      <?php echo $folder; ?>
      <?php echo $navColor; ?>
      >
      The problem is that when I test it locally I get an error that the
      variable in undefined.
      Hello Bob,

      Since your example works on the live server (which is even worse than it
      working on a development server), I would advise you to read up on the ini
      file directive 'register_globa ls':



      If 'register_globa ls' is set to 'on' an end user can easily inject your
      application with variables of their choice like so:



      So I strongly advise you to turn off 'register_globa ls' on the live server.

      HTH


      Comment

      Working...