You are here: Re: still not working: why? « PHP Programming Language « IT news, forums, messages
Re: still not working: why?

Posted by Jerry Stuckle on 05/29/07 18:48

vinnie wrote:
> On May 29, 3:54 am, Erwin Moller
> <since_humans_read_this_I_am_spammed_too_m...@spamyourself.com> wrote:
>> vinnie wrote:
>>> hi guys, i'm just at the beginning. I apologize. the file still gives
>>> me back an error:
>>> <<Parse error: syntax error, unexpected T_VARIABLE, expecting
>>> T_OLD_FUNCTION or T_FUNCTION or T_VAR or '}' in d:\tryphp.php on line
>>> 19>>
>>> why? Can someone fix it so i can "study" the working one?
>>> class somma
>>> {
>>> var $uno=10;
>>> var $due=15;
>>> var $tre=15;
>>> function sum($uno,
>>> $due, $tre)
>>> {
>>> $totale = $uno + $due + $tre;
>>> return($totale);
>>> }
>>> function sum_2()
>>> {
>>> $totale = $this->sum($this->uno, $this-
>>>> due, $this->tre);
>>> return $totale;
>>> print("$totale");
>> Hi Vinnie,
>>
>> Why do you first return something, and then print something on the next
>> line?
>> What do you think will happen?
>> Will the print-statement ever be reached?
>>
>> Regards,
>> Erwin Moller
>>
>>> }
>>> $somma=new_somma();
>>> $sum=$somma->(34,40);
>>> print("$sum");
>>> }
>
> but also if i try to echo $sum, i get nothing, so there must be a
> mistake somewhere, and using the 2 books i have it's hard to find
> (PHP5 for dummies, and core PHP programming).
>

First of all, turn on all errors in your php.ini file and display them:

error_reporting = E_ALL
display_errors = On

So you can see your errors. That should help you a little bit.

--
==================
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

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