Page 1 of 1

Question with undefined PHP function

Posted: Thu Apr 20, 2006 5:22 am
by lhua059
hi there, in my php program i have define a functin called extracDate(), but when i run my program ,its said that the function hasn't been defined..can any one tell me why ? cheers

Code: Select all

extractDate( );

			function extractDate(){
				foreach ($DATE as $Selected_Date){
					$Date_Selected=array();

					if($Selected_Date==""){
						echo "You should select at least one day for your booking";
					}
					if($Selected_Date=="day1"){
						$Date_Selected[]=$preferDATE["day1"];
					}
					if($Selected_Date=="day2"){
						$Date_Selected[]=$preferDATE["day2"];
					}
					if($Selected_Date=="day3"){
						$Date_Selected[]=$preferDATE["day3"];
					}
					if($Selected_Date=="day4"){
						$Date_Selected[]=$preferDATE["day4"];
					}
					if($Selected_Date=="day5"){
						$Date_Selected[]=$preferDATE["day5"];
					}
				}

				echo count($Date_Selected);

			}

Re: Question with undefined PHP function

Posted: Thu Apr 20, 2006 6:23 am
by Zythan
Hello,

May I ask you what you are checking, is it the item from a dropdown list or is the user selecting a radio button ?

TIA

Zythan

Posted: Thu Apr 20, 2006 6:37 am
by Chris Corbyn
I assume this isn't inside a class?

Is that code you posted above the actual code or has it been modified so it can be posted here?

Might be a good idea to post us the original code... don't worry if it's long, it doesn't put me off if I know what I'm looking for :)