Justtechjobs.com Find a programming school near you






Online Campus Both


php-general | 2000071

RE: [PHP] Function calls 101 From: M.vanderMerwe <email protected>
Date: 07/06/00

functions have to be declared before you can call them.

Thys

-----Original Message-----
From: nashirak [mailto:nashirak <email protected>]
Sent: 06 July 2000 16:01
To: php-general
Cc: nashirak
Subject: [PHP] Function calls 101

 Ok I am making this program so that I dont have to type 40 pages of
code with all the same stuff but with different values for each thing.
I am planing on instead writing the 40 pages, but instead of typing out
everthing just write a php3 progam that calls a function and passes
values into this function from a common file. This will be done using
the require ("something"); command and then calling the function
afterwords.

Right now I am testing the function. I have a call to the function
inside of the file I am going to use the require () function on. When I
run it I get an invalid function call. Now I have checked it about 20
times to make sure it is spelled right and everything else but it just
doesnt want to call that function. This is the error it gives me
  Fatal error: Call to unsupported or undefined function displaytable()
in
  http://mypage.com line 6

The function call inside the program looks like this...

<?php
DisplayTable
("Sandwich","5.9","167","290","24","48","9","14","80","27","2","10","50"
,"17","29","10","0","8","0","0","10","870","36","1","4");

 function DisplayTable ($Item, $Servoz, $Serveg, $Cal, $Prog, $Prodv,
Fatg, $fatdv, $CFatc, $CFatp, $SFatg, $SFatdv, $Cholmg, $Choldv, $Carbg,
$Carbdv, $Sugg, $VA, $VC, $Ca, $Ir, $Sodmg, $Soddv, $Fbg, $Fbdv) {

  ... This is where the function stuff is ......

 }
?>

If you could help me out with this that would be great.
I have also tried testing this with the require () statement and it
didn't work either but I am thinking it is the same problem.

 Yes I know this is kinda of newbie question and I know the answer is
going to be easy but I am frustrated right now. :)

Thanks,

nashirak

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: php-general-unsubscribe <email protected>
For additional commands, e-mail: php-general-help <email protected>
To contact the list administrators, e-mail: php-list-admin <email protected>

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: php-general-unsubscribe <email protected>
For additional commands, e-mail: php-general-help <email protected>
To contact the list administrators, e-mail: php-list-admin <email protected>