You are here: Re: call to undefined function php5 « PHP Programming Language « IT news, forums, messages
Re: call to undefined function php5

Posted by Jerry Stuckle on 03/01/06 00:35

Cruella DeVille wrote:
> I'm writing a class to handle reading/writing from/to files like this
> (shortened)
>
> lass FileIO{
> private $filename;
> private $mode;
> private $filePointer;
> private $dictionary;
>
> public function __construct($filename = null, $mode = 'r+'){
> $this->filename = $filename;
> $this->mode = $mode;
> $this->filePointer = $this->openFile();
> $this->dictionary = array();
> }
>
> public function openFile(){
> return fopen($this->filename, $this->mode);
> }
>
> public function writeURL($name, $url){
> $content = $name . " $ " . $url. "\n";
> $this->fwrite($this->filePointer, $content);
> }
>
> when I try to call my writeURL(string, string) method the parser
> returns an error of "call to undefined function)
> my call:
>
> include_once('FileIO.php');
> $myFileIO = new FileIO('siv.txt');
> $myFileIO.writeURL("siv", "nibbler.no");
>
> this is copy/paste, so there's no typing error in the methodcall
> (writeURL())
> What am I doing wrong?
>

Which line is giving you the undefined function?

Also, when you open the file you need to open it as "w" to truncate and
write to it, or "a" to append to it ("w+" or "a+" to read and write).
"r+" only opens it for reading.


--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================

 

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

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