25. april 2008 - 22:45Der er
11 kommentarer og 1 løsning
problemer med file_put_contents
Hej. Jeg har en index.html fil der ser således ud: <form action="opretmappe.php" method="post"> <input type = "text" name ="mappeNavn"> <input type = "text" name ="filnavn"> <input type = "submit" name="submitted" value="Opret mappe">
Her er så min opretmappe.php fil: <?php
//Folder navn fra query string $_SERVER['QUERY_STRING']; $mappeNavn = $_POST['mappeNavn'];
$filnavn = $_POST['filnavn'] . ".php";
$a = $sti . "/" . $mappeNavn . "/" . $filnavn; //sti til den nye mappe $sti = "/srv/www/vhosts/nytwebsite.dk/httpdocs/cms/";
//hele stien til den nye mappe $d = $sti . $mappeNavn;
$indhold = "tis mig";
mkdir($d, 0777, true);
echo file_put_contents($a , $indhold);
?>
Den opretter fint mappen. Men der komme ingen fil? Jeg kan ikke se hvad der er galt, nogen der kan hjælpe mig?
Fejlen er følgende: Warning: file_put_contents() [function.file-put-contents]: Unable to access /mappe/fil.php in /srv/www/vhosts/nytwebsite.dk/httpdocs/cms/opretmappe.php on line 28
Warning: file_put_contents(/mappe/fil.php) [function.file-put-contents]: failed to open stream: No such file or directory in /srv/www/vhosts/nytwebsite.dk/httpdocs/cms/opretmappe.php on line 28
Warning: file_put_contents() [function.file-put-contents]: SAFE MODE Restriction in effect. The script whose uid/gid is 10256/2524 is not allowed to access /srv/www/vhosts/nytwebsite.dk/httpdocs/cms/1 owned by uid/gid 30/8 in /srv/www/vhosts/nytwebsite.dk/httpdocs/cms/opretmappe.php on line 28
Warning: file_put_contents(/srv/www/vhosts/nytwebsite.dk/httpdocs/cms//1/2.php) [function.file-put-contents]: failed to open stream: No such file or directory in /srv/www/vhosts/nytwebsite.dk/httpdocs/cms/opretmappe.php on line 28
Den siger følgende efter dine rettelser: Warning: file_put_contents() [function.file-put-contents]: SAFE MODE Restriction in effect. The script whose uid/gid is 10256/2524 is not allowed to access /srv/www/vhosts/nytwebsite.dk/httpdocs/cms/1 owned by uid/gid 30/8 in /srv/www/vhosts/nytwebsite.dk/httpdocs/cms/opretmappe.php on line 28
Warning: file_put_contents(/srv/www/vhosts/nytwebsite.dk/httpdocs/cms/1/2.php) [function.file-put-contents]: failed to open stream: No such file or directory in /srv/www/vhosts/nytwebsite.dk/httpdocs/cms/opretmappe.php on line 28
Hmm kan det være nogle af mine variabler der er beskyttet navne?
Synes godt om
Ny brugerNybegynder
Din løsning...
Tilladte BB-code-tags: [b]fed[/b] [i]kursiv[/i] [u]understreget[/u] Web- og emailadresser omdannes automatisk til links. Der sættes "nofollow" på alle links.