hi,
i'm a newbie,a very new one.I'm sure that this problem has been resolved thausands of times, but it's two days that i'm blocked.So, please help me.
This script:
<?php
echo "<form name=mod method=post action=".$PHP_SELF.">";

gives me: Notice: Undefined variable: PHP_SELF
the same error id returned by unsing other variables

i've tried usig $_SERVER['PHP_SELF'] but it still won't work.

register globals should be on or off?

    gives me: Notice: Undefined variable: PHP_SELF
    the same error id returned by unsing other variables

    You should be using the $* version of the superglobal variables, e.g., $SERVER['PHP_SELF'].

    i've tried usig $_SERVER['PHP_SELF'] but it still won't work.

    How does it not work?

    register globals should be on or off?

    Keep it off.

      I've downloaded & installed essyphp 2.0 package.in the php directory there are two files: php(ini-reccomended) and php(ini-dist).
      one of them has the register globals on and on the other one they aare set on off.
      which one is the file where the modifies should be made?
      is there any other configuration that i should change or easyphp makes all the necessary configuration changes itself?

      please have patience, as i' ve first said, i'm a newbie. this is the first time i use php

        $_SERVER['PHP_SELF'] gives me:
        Parse error: parse error, unexpected T_VARIABLE, expecting ',' or ';' in

          The error is elsewhere, probably on the same line, probably having to do with embedding the expression in a string. Try:

          <?php
          echo $_SERVER['PHP_SELF'];
          ?>

            Could it be cause by quote?

            <?php
            echo "<form name=\"mod\" method=\"post\" action=".$_SERVER['PHP_SELF'].">";
            ?>
            
            

            Try this..

              the fallowing script

              <?php
                echo "<form name=\"modulo\" method=\"post\" action=".$_SERVER['PHP_SELF'].">";
              ?>
                <p>primo numero
                  <input name="n1" type="text">
                </p>
                <p>secondo numero
                  <input type="text" name="n2">
                </p>
                <p>terzo numero
                  <input type="text" name="n3">
                </p>
                <p>
                  <input type="submit" name="Submit" value="calcola maggiore e minore">
                </p>
              </form>
              <?php
               echo $_POST['n1'];
                echo $_POST['n2'];
                 echo $_POST['n3'];
              
              if (($n1>$n2) && ($n1>$n3))
                {
                $mag=$n1;
                }
                else
                {
                if (($n2>$n3) && ($n2>$n1))
                  {
                  $mag=$n2;
                  }
                  else
                  {
                  $mag=$n3;
                  }
                }
              echo  "MAggiore: ".$mag;
              
              ?>
              

              returns the fallowing errors:

              Notice: Undefined index: n1
              Notice: Undefined index: n2
              Notice: Undefined index: n3
              Notice: Undefined variable: n1
              Notice: Undefined variable: n2
              Notice: Undefined variable: n2 i
              Notice: Undefined variable: n3
              Notice: Undefined variable: n3

              could u pls tell me what did i do wrong?
              thank you for your patience.

                Write a Reply...