Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Problem krika_news_v1.2


Rebellion

Recommended Posts

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>

Link to comment
Share on other sites

  • 4 weeks later...
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>

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...