You are here: Weird Probelms With copy() « PHP Programming Language « IT news, forums, messages
Weird Probelms With copy()

Posted by jerrygarciuh on 12/05/84 11:55

Hi all,

The following script is giving me weird problems. I have in this
directory an index.php and hurricane.php.

If the script gets $i = 'on' it is supposed to back up the current
index into a file called normal.php and then copy hurricane.php into
index.php. This should create a backup of the index and then put the
hurrican alert in place.

When the script gets $i = 'off' it should replace the index with the
contents of normail.php.

What is happening is that at the end of running with $i = 'on' both
index.php and normal.php have the contents of hurricane.php.

Can anyone see why? copy() is returning a 1 every time.

if ($_GET['i'] == 'on') {
$result = copy('index.php', 'normal.php');
if ($result == 1) {
$result .= copy('hurricane.php', 'index.php');
} else {
$result = 'File Copy Failed!';
}
} else if ($_GET['i'] == 'off') {
$result = copy('normal.php', 'index.php');
}

TIA

jg

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация