Ver Mensaje Individual
  #10 (permalink)  
Antiguo 24/06/2009, 15:35
Avatar de chulifo
chulifo
 
Fecha de Ingreso: abril-2009
Ubicación: perdido en codigos del PHP, pero aprendo rapido!
Mensajes: 524
Antigüedad: 15 años
Puntos: 18
Respuesta: Ola Ayuda con un edito para los archivos

mira como puedes ver uso el codigo q puse y consegui
que es este
Código PHP:
<?php
$random1 
'randomly_generated_string';
$random2 'another_randomly_generated_string';
$target_file 'index.html';//el nombre del archivo a editar
$this_file 'editor.php';//el nombre de este archivo

 
{
    if (isset(
$_POST['content']))
        
file_put_contents($target_file'get_magic_quotes_qpc()' stripslashes($_POST['content']) : $_POST['content']);
   
    die(
'<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
    <head>
        <title>Editando archivo</title>
    </head>
    <body>
        <form method="post" action="' 
$this_file '" />
        <input type="hidden" name="' 
$random1 '" value="' $random2 '" />
        <textarea name="content" rows="50" cols="100">' 
file_get_contents($target_file) . '</textarea><br />
        <input type="submit" value="Save Changes" />
        </form>
    </body>
</html>'
);
}
?>
pero lo uqe quiero es cambiar el titulo alnombre de fichero a editar y lopongo asi

Código PHP:
<?php
$random1 
'randomly_generated_string';
$random2 'another_randomly_generated_string';
$target_file 'index.html';//el nombre del archivo a editar
$this_file 'editor.php';//el nombre de este archivo

 
{
    if (isset(
$_POST['content']))
        
file_put_contents($target_file'get_magic_quotes_qpc()' stripslashes($_POST['content']) : $_POST['content']);
   
    die(
'<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
    <head>
        <title>Editando archivo $target_file</title>
    </head>
    <body>
        <form method="post" action="' 
$this_file '" />
        <input type="hidden" name="' 
$random1 '" value="' $random2 '" />
        <textarea name="content" rows="50" cols="100">' 
file_get_contents($target_file) . '</textarea><br />
        <input type="submit" value="Save Changes" />
        </form>
    </body>
</html>'
);
}
?>
si le pongo comillas " salen igualito y si le pongo ' sale error!