fiz esse código: <?php
$nometema = isset($_GET['nometema']) ? $_GET['nometema'] : "";
$URItema = isset($_GET['URItema']) ? $_GET['URItema'] : "";
$descricao = isset($_GET['descricao']) ? $_GET['descricao'] : "";
$autor = isset($_GET['autor']) ? $_GET['autor'] : "";
$URIautor = isset($_GET['URIautor']) ? $_GET['URIautor'] : "";
$dir = mkdir('C:/xampp/htdocs/wordpress/wp-content/themes/'.$nometema);
if(!file_exists($dir.'/index.php') && !file_exists($dir.'/style.php')){
$arqidx = fopen($dir.'/index.php', "x");
$arqcss = fopen($dir.'/style.php', "x");
$stridx = "";
$strcss = "
//*
Theme Name: $nometema
Theme URI: $URItema
Description: $descricao
Author: $autor
Author URI: $URIautor
*//
";
fwrite($arqidx, $stridx);
fwrite($arqcss, $strcss);
fclose($arqidx);
fclose($arqcss);
echo "<h1>Tema Wordpress criado com sucesso!</h1>";
} else{
echo "<h1>Já existem esses arquivo!!!</h1>";
}
?> mas dá esse erro Warning: fopen(1/index.php) [function.fopen]: failed to open stream: No such file or directory in C:\xampp\htdocs\criartemawp\resultado.php on line 24 Warning: fopen(1/style.php) [function.fopen]: failed to open stream: No such file or directory in C:\xampp\htdocs\criartemawp\resultado.php on line 25 Warning: fwrite() expects parameter 1 to be resource, boolean given in C:\xampp\htdocs\criartemawp\resultado.php on line 38 Warning: fwrite() expects parameter 1 to be resource, boolean given in C:\xampp\htdocs\criartemawp\resultado.php on line 39 Warning: fclose() expects parameter 1 to be resource, boolean given in C:\xampp\htdocs\criartemawp\resultado.php on line 42 Warning: fclose() expects parameter 1 to be resource, boolean given in C:\xampp\htdocs\criartemawp\resultado.php on line 43 Eu não entendo, se o arquivo não existe, ele cria, não é?