Results 1 to 11 of 11

Thread: [RESOLVED] writing to directories

  1. #1

    Thread Starter
    Hyperactive Member ninjanutz's Avatar
    Join Date
    Jun 2005
    Location
    Bayside
    Posts
    256

    Resolved [RESOLVED] writing to directories

    i have my script set up so that everyone who registers is added to the users txt file and a directory folder is created for them

    how can i make th created directories with writing permissions so i can have it write the user and pass to the users.txt and write the first name last name and email to the directory folder?

  2. #2
    Hyperactive Member PlaGuE's Avatar
    Join Date
    Jun 2005
    Location
    in ur mind.
    Posts
    445

    Re: writing to directories

    mkdir("path/to/dir-named-$user", 0700);

    well sumwhere alongthat ...lol..
    Without balance, there could only be chaos.
    Without chaos, there could be no balance.
    I live with karma. Eat with destiny. Dream of life without shackles....
    Yet. If life had no consequences, life could not exist, nor could it flourish.


    If at first you dont succeed.You're screwed.

    C++/Java NOOB.

    I aint a professional at PHP, but if i can help i will.

  3. #3

    Thread Starter
    Hyperactive Member ninjanutz's Avatar
    Join Date
    Jun 2005
    Location
    Bayside
    Posts
    256

    Re: writing to directories

    lol im new so leaving me to figure out wat u meant is kinda hard

  4. #4

    Thread Starter
    Hyperactive Member ninjanutz's Avatar
    Join Date
    Jun 2005
    Location
    Bayside
    Posts
    256

    Re: writing to directories

    isnt it 0666?

  5. #5

    Thread Starter
    Hyperactive Member ninjanutz's Avatar
    Join Date
    Jun 2005
    Location
    Bayside
    Posts
    256

    Re: writing to directories

    didnt work

  6. #6
    Hyperactive Member PlaGuE's Avatar
    Join Date
    Jun 2005
    Location
    in ur mind.
    Posts
    445

    Re: writing to directories

    okay... well lets say i had a member signup... and i wanted to give him his own folder to do with at he please... such as a image host...

    well here's a lil singup file i made... a year ago

    i tested it... and it works.. b4 today... idk how... but its never given me errors till just now... and i use it modified mind you in alot of my script... i just added _POST[] n well the _SERVER ****.. to make it not give errors...

    PHP Code:
    <?php

    switch (@$_GET['step']) {

    case 
    "2":

    //replace username and password with your mysql name and password
    $conn mysql_connect("localhost","Admin","blah"); #STICK YOUR OWN GODDAMN INFO IN HERE Example: mysql_connect("localost","Admin","yeah");

    //select the database
    $db mysql_select_db("donald_duck"); #put db there

    //insert the values

    #Check to see if username is in use
    $sql "SELECT * FROM users WHERE username = \"$_POST[usrname]\"";
    $inuse mysql_query($sql
        or die(
    mysql_error());
        
    $check = @mysql_fetch_array($inuse);
      if(
    $check["username"] == NULL) {

        
    $resultMYSQL_QUERY("INSERT INTO users (id, username, password)".
    "VALUES ('NULL', '$_POST[usrname]', '$_POST[password]')");
          
    mkdir("$_SERVER[DOCUMENT_ROOT]/$_POST[usrname]"0777);
          echo(
    "
            
    $_POST[usrname] has been successfully added.<br><br>
    <b>Username:</b> 
    $_POST[usrname]<br>
    <b>Password:</b> 
    $_POST[password]<br>
    if you are a team member you will have access to
    $_SERVER[DOCUMENT_ROOT]/$_POST[usrname]");

      }
      else {
        echo(
    "
            <center> Sorry, but that name is already in use. <font size=2 face=verdana><b><br>Go <a href=signup.php>back</a> and try again</font></b></center>
        "
    );
      }

       break; default:
    echo
    "<form action=signup_en.php?step=2 method=post>
      <table width=100% border=0>
        <tr> 
          <td width=12%>Username Desired:</td>
          <td width=88%><input type=text name=usrname size=25></td>
        </tr>
        <tr> 
          <td>Password Desired:</td>
          <td><input type=password name=password size=26></td>
        </tr>
        <tr>
          <td><input type=submit value=submit name=submit></td>
          <td></td>
        </tr>
      </table>
      </form>"
    ;
    break;
    }
    ?>
    Last edited by PlaGuE; Aug 21st, 2005 at 05:16 AM.
    Without balance, there could only be chaos.
    Without chaos, there could be no balance.
    I live with karma. Eat with destiny. Dream of life without shackles....
    Yet. If life had no consequences, life could not exist, nor could it flourish.


    If at first you dont succeed.You're screwed.

    C++/Java NOOB.

    I aint a professional at PHP, but if i can help i will.

  7. #7

    Thread Starter
    Hyperactive Member ninjanutz's Avatar
    Join Date
    Jun 2005
    Location
    Bayside
    Posts
    256

    Re: writing to directories

    only problem with that is my servers so bootleg it supports php but not MySQL

  8. #8

    Thread Starter
    Hyperactive Member ninjanutz's Avatar
    Join Date
    Jun 2005
    Location
    Bayside
    Posts
    256

    Re: writing to directories

    my script does give them the folder though for all their stuff but i cant get that folder to be written in im guessing it would ahve to make a txt in the folder inorder tow rite cause ive never opened a folder and seen writing lol

  9. #9
    Hyperactive Member PlaGuE's Avatar
    Join Date
    Jun 2005
    Location
    in ur mind.
    Posts
    445

    Re: writing to directories

    OooOo... if your host cant support mysql i'd try a friend of mine... at MyAtom.net. He build his own database. called Atom_DB. its a text file system. and just as powerful. When you msg him. Tell him PlaGuE sent you. oh and btw... im a team member of myatom.net
    Without balance, there could only be chaos.
    Without chaos, there could be no balance.
    I live with karma. Eat with destiny. Dream of life without shackles....
    Yet. If life had no consequences, life could not exist, nor could it flourish.


    If at first you dont succeed.You're screwed.

    C++/Java NOOB.

    I aint a professional at PHP, but if i can help i will.

  10. #10

    Thread Starter
    Hyperactive Member ninjanutz's Avatar
    Join Date
    Jun 2005
    Location
    Bayside
    Posts
    256

    Re: writing to directories

    ok but anyway even though my server doesnt support MySQL my computer does but i have a program called xampp that came with php 5 and mysql and a few other things in 1 and i dont no where to go to set the password for the MySQL user nor do i no how to make a new account for it. could u help me out?

  11. #11

    Thread Starter
    Hyperactive Member ninjanutz's Avatar
    Join Date
    Jun 2005
    Location
    Bayside
    Posts
    256

    Re: writing to directories

    i'll make a new thread for this question

Posting Permissions

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



Click Here to Expand Forum to Full Width