Re: AW: [PHP] Fatal Error: Call to unsusamplepported or Undefined function search()/usr/local/apache/htdocs/sample/looks.php3
| From: | Robin Vickery | Date: | Tue, 22 Aug 2000 10:56:21 +0000 |
| Subject: | Re: AW: [PHP] Fatal Error: Call to unsusamplepported or Undefined function search()/usr/local/apache/htdocs/sample/looks.php3 | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-12920@lists.php.net to get a copy of this message | ||
sys.op@descartes.onevirtual.net (System Operator) writes:
> Yes sir, I do declare that functions.
>
> On Tue, 22 Aug 2000, Jens Wabnitz wrote:
>
> > Do you have declared the function before you call it ?
> >
> > Bye Jens
> >
> >
> > -----Ursprungliche Nachricht-----
> > Von: System Operator [mailto:sys.op@descartes.onevirtual.net]
> > Gesendet: Montag, 21. August 2000 23:20
> > An: php
> > Betreff: [PHP] Fatal Error: Call to unsusamplepported or Undefined
> > function search()/usr/local/apache/htdocs/sample/looks.php3
> >
> >
> >
> > hello,
> >
> > Any idea 'bout this error, here is my sample scripts.
> >
> > under the main.php3
> >
> > <a href="/sample/looks.php3?a=search"
> > target="window1">Search</a><br>
> >
> > under the looks.php3
> >
> > <?
> > include("config.php3");
> > switch ($a):
> > case search;
> > search();
> > break;
> > etc.......
> >
> > function search()
> > {
> > PRINT
> > .....etc
Yes, you've declared the function, but in PHP3 you have to declare it _before_
it's used. Otherwise you get exactly the error you're describing.
eg. This works fine:
<?php
function search()
{
print "hello";
}
switch ($a):
case search:
search();
break;
endswitch;
?>
But this gives the error 'Fatal error: Call to unsupported or undefined function
search()...'
<?php
switch ($a):
case search:
search();
break;
endswitch;
function search()
{
print "hello";
}
?>
--
Robin Vickery...............................................
Planet-Three, 3A West Point, Warple Way, London, W3 0RG, UK
Email: robin@planet-three.net Phone: +44 (0)870 729 5444