Loading ...
Sorry, an error occurred while loading the content.

register globals: Off (new!)

Expand Messages
  • spacerom_online
    Gia sas, signomi gia to proigoumeno mail mou. To egrapsa me ellinikous ISO xaraktires kai den ixera to apotelesma. Opos isos katalabate eimai kainourgios se se
    Message 1 of 2 , Jul 3, 2006
    • 0 Attachment
      Gia sas, signomi gia to proigoumeno mail mou. To egrapsa me
      ellinikous ISO xaraktires kai den ixera to apotelesma. Opos isos
      katalabate eimai kainourgios se se autin edw tin lista. Katarxas
      loipon gia xara stin lista!

      To problima pou me apasxolei exei na kanei me ta global variables
      stin PHP 5. Exo ktisei to parakato script se mia HTML selida,
      prokeitai gia ena guestbook enos site:

      <form action="<? echo $PHP_SELF?>" method="post">
      <textarea cols="60" rows="5" name="opinion"></textarea>
      <input type="submit" value="send your opinion!">
      </form>

      <?
      $day = date ("d/m/y");
      $time = date ("h:i:s a");
      $border=0;
      $bordercolor="#999999";
      $bgcolor="#000000";
      if(isset ($opinion)) {
      $fp = fopen("guests.txt", "a");
      fwrite ($fp,"<table border=$border bordercolor=$bordercolor
      bgcolor=$bgcolor><tr><td>".$day."-".$time."<p>".$opinion."</td></tr></table><p>\\
      n");
      fclose($fp);
      }

      ?>
      <p>Writen messages:</p>
      <? readfile ("guests.txt") ?>


      To thema loipon einai oti ston apache server pou xrisimopoio spiti ta
      register_globals einai Off apo default. Auto mporw na to alla3o ston
      apache (kai otan to kano to script leitourgei perifima), oxi omos kai
      se enan web server opou o kathe provider thetei ta globals Off gia
      logous asfaleias (kai kala kanei diladi).

      Auto pou prospathisa ews twra einai na alla3o to trick me to
      $PHP_SELF kai na to metagrapso se $HTTP_SERVER_VARS['PHP_SELF'] kai
      $_SERVER['PHP_SELF'], omos kanena apo ta duo den petuxe kai ta
      variables den grafontai kan sto guests.txt :(
      Mipos exrei kapoios mia lisi pano se auto? Episis oso anafora to
      variable "option", tha prepei isos na to metagrapso san
      $_SESSION['opinion'] h kati paromoio gia na doulepsei me ta globals Off?
      To script pantos einai ok me ta global On.

      Opoios tha mporouse na boithisei tou eimai pragmatika eugnomon :)

      Euxaristo ek twn proteron
      Kostas Plastiras
    • Sofoklis Magoulas
      loipon ... mporeis na ftiakseis ena arxeio php.ini sto fakelo pou se endiaferei kai na valeis mesa mia seira me to akoloutho register_globals = On apo ekei kai
      Message 2 of 2 , Jul 3, 2006
      • 0 Attachment
        loipon ...
        mporeis na ftiakseis ena arxeio php.ini sto fakelo pou
        se endiaferei kai na valeis mesa mia seira me to
        akoloutho

        register_globals = On

        apo ekei kai pera tha pezei kanonika to script sou


        --- spacerom_online <spacerom_online@...> έγραψε:

        > Gia sas, signomi gia to proigoumeno mail mou. To
        > egrapsa me
        > ellinikous ISO xaraktires kai den ixera to
        > apotelesma. Opos isos
        > katalabate eimai kainourgios se se autin edw tin
        > lista. Katarxas
        > loipon gia xara stin lista!
        >
        > To problima pou me apasxolei exei na kanei me ta
        > global variables
        > stin PHP 5. Exo ktisei to parakato script se mia
        > HTML selida,
        > prokeitai gia ena guestbook enos site:
        >
        > <form action="<? echo $PHP_SELF?>" method="post">
        > <textarea cols="60" rows="5"
        > name="opinion"></textarea>
        > <input type="submit" value="send your opinion!">
        > </form>
        >
        > <?
        > $day = date ("d/m/y");
        > $time = date ("h:i:s a");
        > $border=0;
        > $bordercolor="#999999";
        > $bgcolor="#000000";
        > if(isset ($opinion)) {
        > $fp = fopen("guests.txt", "a");
        > fwrite ($fp,"<table border=$border
        > bordercolor=$bordercolor
        >
        bgcolor=$bgcolor><tr><td>".$day."-".$time."<p>".$opinion."</td></tr></table><p>\\
        > n");
        > fclose($fp);
        > }
        >
        > ?>
        > <p>Writen messages:</p>
        > <? readfile ("guests.txt") ?>
        >
        >
        > To thema loipon einai oti ston apache server pou
        > xrisimopoio spiti ta
        > register_globals einai Off apo default. Auto mporw
        > na to alla3o ston
        > apache (kai otan to kano to script leitourgei
        > perifima), oxi omos kai
        > se enan web server opou o kathe provider thetei ta
        > globals Off gia
        > logous asfaleias (kai kala kanei diladi).
        >
        > Auto pou prospathisa ews twra einai na alla3o to
        > trick me to
        > $PHP_SELF kai na to metagrapso se
        > $HTTP_SERVER_VARS['PHP_SELF'] kai
        > $_SERVER['PHP_SELF'], omos kanena apo ta duo den
        > petuxe kai ta
        > variables den grafontai kan sto guests.txt :(
        > Mipos exrei kapoios mia lisi pano se auto? Episis
        > oso anafora to
        > variable "option", tha prepei isos na to metagrapso
        > san
        > $_SESSION['opinion'] h kati paromoio gia na
        > doulepsei me ta globals Off?
        > To script pantos einai ok me ta global On.
        >
        > Opoios tha mporouse na boithisei tou eimai
        > pragmatika eugnomon :)
        >
        > Euxaristo ek twn proteron
        > Kostas Plastiras
        >
        >
        >
        >


        Sofoklis Magoulas

        Web master of Sympan network
        Internet and computer support
        37 Mesogeion str, Maroussi
        15126, Athens Greece






        ___________________________________________________________
        Χρησιμοποιείτε Yahoo!;
        Βαρεθήκατε τα ενοχλητικά μηνύματα (spam); Το Yahoo! Mail
        διαθέτει την καλύτερη δυνατή προστασία κατά των ενοχλητικών
        μηνυμάτων http://login.yahoo.com/config/mail?.intl=gr
      Your message has been successfully submitted and would be delivered to recipients shortly.