Php to create new pages with username is it correct?

Discussion in 'PHP' started by TheSyndicate, Jul 7, 2008.

  1. #1
    I want to make a new page and then close the 777 but my server do not do it or they telling me my code is wrong. It is?

    <?php
    include ("conn.php");
    
    $sql = "SELECT * FROM users where users_mkdir='N' limit 5";
    $result = mysql_query($sql) or die(mysql_error());
    $rows=mysql_num_rows($result);
    
    echo $rows . "<br><br>";
    
    chmod("/chmod("/xxxxxxxxxxxxxxxx/xxxxxxxxxx.com/", 0777);
    
    while ($row=mysql_fetch_array($result)) {
    		$uid =$row["users_id"];
    		$uname =$row["users_name"];
    		$ucategory =$row["users_category"];
    		$ustatus =$row["user_status"];		
    
    		$sqlupdate = "Update users set users_mkdir= 'Y' where users_id = '$uid' ";
    		mysql_query($sqlupdate);
    
    	    mkdir($uname, 0755);
    
    		sleep(1);
    		
    		$filename="index.php";
    		$filenum=fopen("$uname/$filename", "w");
    		$mystr='<? include ("../users-template.php"); ?>';
    		$fputs($filenum, $mystr);
    		fclose($filenum);
    
    		
    }
    
    chmod("/xxxxxxxxxxxxxxxx/xxxxxxxxxx.com/", 0755);
    
    ?>
    PHP:
     
    TheSyndicate, Jul 7, 2008 IP
  2. Danltn

    Danltn Well-Known Member

    Messages:
    679
    Likes Received:
    36
    Best Answers:
    0
    Trophy Points:
    120
    #2
    chmod("/chmod("/xxxxxxxxxxxxxxxx/xxxxxxxxxx.com/", 0777);

    What's up with that line?

    Dan
     
    Danltn, Jul 7, 2008 IP
  3. TheSyndicate

    TheSyndicate Prominent Member

    Messages:
    5,410
    Likes Received:
    289
    Best Answers:
    0
    Trophy Points:
    365
    #3
    some one told me not to give me the direct link to my server and that code is correct
     
    TheSyndicate, Jul 7, 2008 IP
  4. Danltn

    Danltn Well-Known Member

    Messages:
    679
    Likes Received:
    36
    Best Answers:
    0
    Trophy Points:
    120
    #4
    Well there's 3 double quote marks.

    I don't know what you're trying to do, but in this example (ignoring the xxxx etc) that is definitely incorrect. You can clearly see from the colour of the PHP Code block.

    Dan
     
    Danltn, Jul 7, 2008 IP
  5. TheSyndicate

    TheSyndicate Prominent Member

    Messages:
    5,410
    Likes Received:
    289
    Best Answers:
    0
    Trophy Points:
    365
    #5
    Oki i will check that out anything else?
     
    TheSyndicate, Jul 8, 2008 IP