You are here: Re: saving data from a form into a seperate .html file « PHP Programming Language « IT news, forums, messages
Re: saving data from a form into a seperate .html file

Posted by vdP on 10/27/26 11:33

Brian wrote:
> ok that worked i changed the code a little bit, now I'm getting an
> error like this:
> Fatal error: Function name must be a string in
> /usr/local/www/billcalculation.php on line 36
>
> $fp = fopen($_POST['month'] . ".html","a+");
> $fwrite ($fp, $data);
> fclose($fp);
>
> $data = print "Apartment: $apartment_rent"; //want it to print that to
> the new .html file.
> thats what I have, why am I getting this error?
>

A few things:
1. Read http://www.safalra.com/special/googlegroupsreply/ about how to
use Google groups.
2. I hope you defined $data before you try to write it to the new html-file.
3. (By far the most important point.) The print function outputs the
given string as normal html, i.e. you will see it in your browser if you
open billcalculation.php . The statement above assigns the result of the
print function (which is always the integer 1) to $data. Hence, the
number 1 should be written to the new html-file. Instead use
$data="Apartment: $apartment_rent";
$fwrite ($fp, $data);
(And if you want to show it in billcalculation.php as well, throw in
print $data; )

Hope this helps.

vdP

 

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

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