Rebellion Posted April 9, 2008 Posted April 9, 2008 When trying to edit the news and press the button to send get the following error message. I have to edit the files that CHMOD 777 in all of them. Español_news.txt and English_news.txt This is the message of error: Error al abrir el archivo para escribir en él Warning: fclose(): supplied argument is not a valid stream resource in C:\wamp\www\catalog\admin\action_news.php on line 55. This is the content of the file action_news.php <?php /* $Id: action_news.php,v1.0 2004/05/10 22:50:51 osCommerce, Open Source E-Commerce Solutions http://www.oscommerce.com Copyright (c) 2003 osCommerce Released under the GNU General Public License */ require('includes/application_top.php'); include('includes/languages/' . $language . '/edit_news.php'); ?> <HTML> <HEAD> <link rel="stylesheet" type="text/css" href="includes/stylesheet.css"> <script language="JavaScript"> function redimenciona () { var h=260; var w=360; self.resizeTo(w,h); window.moveTo(400,200); } </script> </HEAD> <BODY LEFTMARGIN="0" TOPMARGIN="0" MARGINWIDTH="0" MARGINHEIGHT="0" ONLOAD="redimenciona()"> <CENTER> <table border="0" cellspacing="0" cellpadding="0" align="center" class="infoboxcontent" width="100%" height="100%"> <tr> <td align="center" class="specialprice"> <?php /* La variable $nombre contiene el path y nombre del archivo txt. La variable $textonoticias es la que contiene la noticia */ if ($fp=fopen ($nombre,'wb')) { fwrite($fp,stripslashes($textonoticias)); echo '<b>' . EXIT_FINISH . '<br>'; echo NAME_FILE_FINISH . $nombre . '</b>'; } else { echo ERROR_WRITE_FINISH; } fclose($fp); ?> </td> </tr> </table> </CENTER> </BODY> </HTML> Quote
focifoci Posted May 8, 2008 Posted May 8, 2008 help me please! I have the same problem, but could not find the solution right now Quote
Rebellion Posted May 8, 2008 Author Posted May 8, 2008 I have the same problem, but could not find the solution right now this is the solution <?php /* $Id: action_news.php,v1.0 2004/05/10 22:50:51 osCommerce, Open Source E-Commerce Solutions http://www.oscommerce.com Copyright (c) 2003 osCommerce Released under the GNU General Public License */ require('includes/application_top.php'); include('includes/languages/' . $language . '/edit_news.php'); ?> <HTML> <HEAD> <link rel="stylesheet" type="text/css" href="includes/stylesheet.css"> <script language="JavaScript"> function redimenciona () { var h=260; var w=360; self.resizeTo(w,h); window.moveTo(400,200); } </script> </HEAD> <BODY LEFTMARGIN="0" TOPMARGIN="0" MARGINWIDTH="0" MARGINHEIGHT="0" ONLOAD="redimenciona()"> <CENTER> <table border="0" cellspacing="0" cellpadding="0" align="center" class="infoboxcontent" width="100%" height="100%"> <tr> <td align="center" class="specialprice"> <?php /* La variable $nombre contiene el path y nombre del archivo txt. La variable $textonoticias es la que contiene la noticia */ if ($fp=fopen ($_POST["nombre"],'wb')) { fwrite($fp,stripslashes($_POST["textonoticias"])); echo '<b>' . EXIT_FINISH . '<br>'; echo NAME_FILE_FINISH . $_POST["nombre"] . '</b>'; } else { echo ERROR_WRITE_FINISH; } fclose($fp); ?> </td> </tr> </table> </CENTER> </BODY> </HTML> Quote
focifoci Posted May 8, 2008 Posted May 8, 2008 (edited) this is the solution Many thanks rebellion for your incredible "High Speed" Help. Everything OK now Edited May 8, 2008 by focifoci Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.