Professional Web Applications Themes

Dirname File - PHP Development

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...

  1. #1

    Default 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


    Joca Guest

  2. #2

    Default Re: Dirname File


    "Joca" <josecarlossiadv.com> wrote in message
    news:be3f2j$e2o$1nsnmrro2-gest.nuria.telefonica-data.net...
    > 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
    >
    >
    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_VARIABLES);
    ?>



    Randell D. Guest

  3. #3

    Default Re: Dirname File

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

    That should be __FILE__ (double underscores).
    [url]http://www.php.net/manual/en/language.constants.predefined.php[/url]

    Cl1mh4224rd Guest

Similar Threads

  1. #38933 [NEW]: dirname not support binary file path
    By foxgoblin at gmail dot com in forum PHP Bugs
    Replies: 1
    Last Post: September 23rd, 12:12 PM
  2. #25450 [Com]: dirname() not working correct
    By roberthunter21 at yahoo dot co dot uk in forum PHP Development
    Replies: 0
    Last Post: September 9th, 08:47 PM
  3. #25450 [Fbk->Opn]: dirname() not working correct
    By robert_hunter21 at yahoo dot co dot uk in forum PHP Development
    Replies: 0
    Last Post: September 9th, 08:46 PM
  4. #25450 [Opn->Fbk]: dirname() not working correct
    By sniper@php.net in forum PHP Development
    Replies: 0
    Last Post: September 9th, 03:24 PM
  5. Replies: 2
    Last Post: August 14th, 02:10 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139