Fix a simple PHP script

  • Статус Завершено
  • Бюджет $10 - $30 AUD
  • Усього заявок 19

Опис проекту

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>";

}

?>

Отримайте безкоштовно цінові пропозиції на схожі проекти
Виконано:
Необхідні навички

Хочете заробити?

  • Визначте бюджет та часові рамки
  • Опишіть свою пропозицію
  • Отримайте оплату за свою роботу

Найняти фрілансерів, які також подавали заявки в цей проект

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