You are here: problem with fwrite() « All PHP « IT news, forums, messages
problem with fwrite()

Posted by Madame Blablavatsky on 10/07/05 13:11

hello,

i want to make a php page on the fly.
i have made a very basic page that works fine:

------------ basic page source -------------
/* make file */
$file = fopen("02_output.php","w");

/* make source code for the new php page */
/* $inhoud = "<? echo 'wie wil er naar de kermis' ?>"; */

/* write code to the new php page */
$schrijven = fwrite($file, $inhoud);

fclose($file);
-----------------------------------------------

------------ source code from new php page: 02_output.php ---------
<? echo 'wie wil er naar de kermis' ?>
-----------------------------------------------------------------------

the problem is when the page gets a different structure: (see source code
below)

----------------- new basic page source ---------------------------
/* make file */
$file = fopen("02_output.php","w");

/* make source code for the new php page */
$inhoud .= "<? echo" ;
$inhoud .= " 'wie wil er naar de kermis'";
$inhoud .= " ?>";
*/

/* write code to the new php page */
$schrijven = fwrite($file, $inhoud);

fclose($file);
----------------------------------------------------------------------

when i want to open the new page (02_output.php) i get an error message:

Parse error: parse error, expecting `','' or `';'' in
c:\apache\htdocs\zrommelen\file_maken_20051007_02\02_output.php on line 1

i have tried everything, as far as i know, but i can't get it to work.

thanks

 

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

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