'Undefined Variable' help...

From: Date: Tue, 04 Sep 2001 16:26:12 +0000
Subject: 'Undefined Variable' help...
Groups: php.general 
Request: Send a blank email to php-general+get-65905@lists.php.net to get a copy of this message
OK, I have a problem calling a function using default variables. In 'gallery.inc': --------------------------------- function gallery ($filename, $first = 1, $tablewidth = 4, $total = 20) { echo "Filename: $filename, First image: $first, Table Width: $tablewidth, Total: $total"; } --------------------------------- In 'gallery.php': --------------------------------- include('/path/to/gallery.inc'); ... gallery('test.txt',$first,$width,$images); --------------------------------- $first, $width and $images are variables that are defined by the URL, as if they were submitted through a form using HTTP GET, and they are designed to be used like that. My problem is, if I don't define those variables in the URL when I run gallery.php, PHP will come back with 'Undefined Variable' errors. Is there any way I can prevent that from happening? TIA! -- Uchendu Nwachukwu unndunn AT yahoo DOT com - www.unndunn.com

« previous php.general (#65905) next »