BIG help needed
Posted: Tue Mar 09, 2004 6:24 am
can someone please tell me why this doesnt work:
i want it to check if a certain day/period has been booked (//Check if in use)
Dave (http://www.flashworld.co.uk)
?>
Code: Select all
<?
/////////////////////////////////
//collect varriables to be used//
/////////////////////////////////
//get pass user defined
$name=$_POST['name'];
$subject=$_POST['subject'];
$period=$_POST['period'];
$day=$_POST['day'];
/////////////
//functions//
/////////////
//log booking
$fp = fopen("bookings.txt", "a");
$string = "&$day$period=$name - $subject \r\n";
$write = fputs($fp, $string);
fclose($fp);
//Check if in use
$txt_file = fopen("bookings.txt", "rb");
while($file_line = fgets($txt_file)){
$line_array = explode(",", $file_line);
$username = $line_array[0];
if($username == &$day$period){
echo "That name is taken!";
}
}
header ('Location: upmicro.html');
?>Dave (http://www.flashworld.co.uk)
?>