Web Analytics Made Easy -
StatCounter creating directory - CodingForum

Announcement

Collapse
No announcement yet.

creating directory

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • creating directory

    PHP Code:
     mkdir($username/password) ; 


    gives me:


    Warning: Division by zero in /var/www/html/forum/users/registerprocessor.php on line 83
    ~Designer's Toolz~

  • #2
    A funny question, I'll save that ;-)

    You never cared about strings? (No, not that beatiful little tangas...)
    You never put Strings in Quotes? (Things like this " or ' )
    Surely you noticed that here (http://php.net/mkdir) they say some strange thing like this function requires a string as first argument and that they put this strange string in such strange quotes in the given examples?

    *scnr*

    Just use:

    PHP Code:
    mkdir("$username/password"); 
    Or, alternatively:

    PHP Code:
    mkdir($username "/password"); 
    www.united-scripts.com
    www.codebattles.org

    Comment


    • #3
      I figured it out. It was deviding $username which has a value of 0 and you cant devide by 0.....thats not what i wanted it to do but it did that because i didnt change the directory....just has to add :


      PHP Code:
      chdir("$username"); 
      ~Designer's Toolz~

      Comment


      • #4
        figured it out. It was deviding $username which has a value of 0 and you cant devide by 0.....
        Yes, you divided $username, but the value of $username is not relevant, the "divide by 0" error comes 'couse you divided by password.
        And password is neither a variable nor something else - it's just nothing.

        thats not what i wanted it to do but it did that because i didnt change the directory....just has to add
        ehm... sorry, I didn't understand what you're trying to do...
        If it works now... great ;-)
        www.united-scripts.com
        www.codebattles.org

        Comment


        • #5
          Yup, works. Thanks for taking the time to follow up on this.
          ~Designer's Toolz~

          Comment


          • #6
            now piz, password could have been a constant...i guess.... er....but that'll still return a num type...herm...

            Comment


            • #7
              now piz, password could have been a constant...
              argh... no... what a programming style...
              ;-)
              www.united-scripts.com
              www.codebattles.org

              Comment

              Working...
              X