Results 1 to 3 of 3

Thread: PHP Error.

  1. #1
    Join Date
    Dec 2007
    Posts
    2,807
    Tokens
    0

    Latest Awards:

    Default PHP Error.

    Ive got this PHP code which creates a folder and copies certain files into it:
    Code:
    <?php 
    $Name = $_POST['User'];  
    mkdir ($Name, 0777);
     
    copy('Names.php', $Name . '/Names.php');
    chmod($Name . '/Names.php', 0777)
     
    copy('ChangeText.php', $Name . '/ChangeText.php');
    chmod($Name . '/ChangeText.php', 0777)
     
    copy('Names.plist', $Name . '/Names.plist');
    chmod($Name . '/Names.plist', 0777)
     
    copy('Online.php', $Name . '/Online.php');
    chmod($Name . '/Online.php', 0777)
     
    copy('Online.txt', $Name . '/Online.txt');
    chmod($Name . '/Online.txt', 0777)
     
    copy('Position.php', $Name . '/Position.php');
    chmod($Name . '/Position.php', 0777)
     
    copy('Text.plist', $Name . '/Text.plist');
    chmod($Name . '/Text.plist', 0777)
    
    ?>
    But this error appears:
    Parse error: syntax error, unexpected T_STRING in /home/camcreat/public_html/Newuser.php on line 8
    Any help? What do I need to change?

  2. #2
    Join Date
    Feb 2006
    Location
    Scotland
    Posts
    2,087
    Tokens
    138

    Latest Awards:

    Default

    You have forgotten to add the ; on each of the chmod functions

    PHP Code:
    <?php 
    $Name 
    $_POST['User'];  
    mkdir ($Name0777);
     
    copy('Names.php'$Name '/Names.php');
    chmod($Name '/Names.php'0777);
     
    copy('ChangeText.php'$Name '/ChangeText.php');
    chmod($Name '/ChangeText.php'0777);
     
    copy('Names.plist'$Name '/Names.plist');
    chmod($Name '/Names.plist'0777);
     
    copy('Online.php'$Name '/Online.php');
    chmod($Name '/Online.php'0777);
     
    copy('Online.txt'$Name '/Online.txt');
    chmod($Name '/Online.txt'0777);
     
    copy('Position.php'$Name '/Position.php');
    chmod($Name '/Position.php'0777);
     
    copy('Text.plist'$Name '/Text.plist');
    chmod($Name '/Text.plist'0777);

    ?>

  3. #3
    Join Date
    Dec 2007
    Posts
    2,807
    Tokens
    0

    Latest Awards:

    Default

    Oh crap yeh. Cheers! +Rep

Posting Permissions

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