Fix a simple PHP script

  • Estado Completado
  • Presupuesto $10 - $30 AUD
  • Total de ofertas 19

Descripción del proyecto

I wrote a script to open, edit and save a css file.

It only works if I put the css file in the same directory as the php script.

I need it to work when the css file is in a different directory to the css script.

For example:

The script is located in: /public_html/admin/[url removed, login to view]

The file I want to edit is located in: /public_html/includes/templates/responsive_classic/css/[url removed, login to view]

Please look at the script and see what is wrong.

The code I am using is:

<?php

if($_POST['Submit']){

$open = fopen('../includes/templates/responsive_classic/css/[url removed, login to view]',"w+");

$text = $_POST['update'];

fwrite($open, $text);

fclose($open);

echo "File updated.<br />";

echo "File:<br />";

$file = file('../includes/templates/responsive_classic/css/[url removed, login to view]');

foreach($file as $text) {

echo $text."<br />";

}

}else{

$file = file('../includes/templates/responsive_classic/css/[url removed, login to view]');

echo "<form action=\"".$PHP_SELF."\" method=\"post\">";

echo "<textarea Name=\"update\" cols=\"35\" rows=\"35\">";

foreach($file as $text) {

echo $text;

}

echo "</textarea>";

echo "<input name=\"Submit\" type=\"submit\" value=\"Update\" />\n

</form>";

}

?>

Obtén cotizaciones gratis para un proyecto como este
Completado por:
Habilidades necesarias

¿Buscas ganar algo de dinero?

  • Fija tu plazo y presupuesto
  • Describe tu propuesta
  • Recibes pagos por tu trabajo

Contrata Freelancers que también oferten en este proyecto

    • Forbes
    • The New York Times
    • Time
    • Wall Street Journal
    • Times Online