פורסם 2007 באוקטובר 1418 שנים מישהו יכול להגיד לי מה הפונקציה ליצור קובץ על שרת נגיד יש לי דבר כזה <?$username = $_POST['username'];?> אז אני צריך פונצקיה שתיצור לי קובץ $username.something עם תוכן שאני יקבע.. תודה
פורסם 2007 באוקטובר 1418 שנים <?php$filename = 'test.txt';$somecontent = "Add this to the file\n";// Let's make sure the file exists and is writable first.if (is_writable($filename)) { // In our example we're opening $filename in append mode. // The file pointer is at the bottom of the file hence // that's where $somecontent will go when we fwrite() it. if (!$handle = fopen($filename, 'a')) { echo "Cannot open file ($filename)"; exit; } // Write $somecontent to our opened file. if (fwrite($handle, $somecontent) === FALSE) { echo "Cannot write to file ($filename)"; exit; } echo "Success, wrote ($somecontent) to file ($filename)"; fclose($handle);} else { echo "The file $filename is not writable";}?> http://il.php.net/fwrite
פורסם 2007 באוקטובר 1418 שנים מחבר <?php$filename = 'test.txt';$somecontent = "Add this to the file\n";// Let's make sure the file exists and is writable first.if (is_writable($filename)) { // In our example we're opening $filename in append mode. // The file pointer is at the bottom of the file hence // that's where $somecontent will go when we fwrite() it. if (!$handle = fopen($filename, 'a')) { echo "Cannot open file ($filename)"; exit; } // Write $somecontent to our opened file. if (fwrite($handle, $somecontent) === FALSE) { echo "Cannot write to file ($filename)"; exit; } echo "Success, wrote ($somecontent) to file ($filename)"; fclose($handle);} else { echo "The file $filename is not writable";}?> http://il.php.net/fwriteתודה 8)
ארכיון
דיון זה הועבר לארכיון ולא ניתן להוסיף בו תגובות חדשות.