Dirname File

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

    Dirname File

    Hi.

    I have a problem with a dirname. I can´t read a file if i write this code:

    <?php
    $user = $_REQUEST['username'];
    $filename = dirname(_FILE_) .'/../revadv/$user';
    $lines = file($filename) ;
    ?>

    I have create a file with $user name. I write in the php page which i create
    the file $user name:

    $user = $_POST['username']; but it isn´t well..

    If I write in php page with dirname: echo "$user"; it don´t write anything.

    Thank you.
    Regards
    Joca


  • Randell D.

    #2
    Re: Dirname File


    "Joca" <josecarlos@sia dv.com> wrote in message
    news:be3f2j$e2o $1@nsnmrro2-gest.nuria.tele fonica-data.net...[color=blue]
    > Hi.
    >
    > I have a problem with a dirname. I can´t read a file if i write this code:
    >
    > <?php
    > $user = $_REQUEST['username'];
    > $filename = dirname(_FILE_) .'/../revadv/$user';
    > $lines = file($filename) ;
    > ?>
    >
    > I have create a file with $user name. I write in the php page which i[/color]
    create[color=blue]
    > the file $user name:
    >
    > $user = $_POST['username']; but it isn´t well..
    >
    > If I write in php page with dirname: echo "$user"; it don´t write[/color]
    anything.[color=blue]
    >
    > Thank you.
    > Regards
    > Joca
    >
    >[/color]

    If you managed to pass values successfully from the client, their variable
    names and values will appear in a nice table format if you use

    <?
    phpinfo(INFO_VA RIABLES);
    ?>



    Comment

    • Cl1mh4224rd

      #3
      Re: Dirname File

      Joca wrote:[color=blue]
      > $filename = dirname(_FILE_) .'/../revadv/$user';[/color]
      ^^^^^^

      That should be __FILE__ (double underscores).


      Comment

      Working...