01hanstu Posted November 12, 2009 Share Posted November 12, 2009 We have a booking system and we are trying to get it so that if you select the room then you will be able to see information about the room. the following is from the booking system if (isset($_POST['selectroom'])) {$_SESSION['room'] = $_POST['selectroom'];} if (!isset($_SESSION['room'])) $room = "C08"; else $room = $_SESSION['room']; Then my new bit of code is: if ($room='C08') print "ICT Suite with 29 RM One Computers."; else print "No details are available for this room yet."; But it keeps using the variable at the top (in bold). Please Help Link to comment https://forums.phpfreaks.com/topic/181250-if-variable/ Share on other sites More sharing options...
otuatail Posted November 12, 2009 Share Posted November 12, 2009 Have you got session_start(); ? Desmond. Link to comment https://forums.phpfreaks.com/topic/181250-if-variable/#findComment-956170 Share on other sites More sharing options...
01hanstu Posted November 12, 2009 Author Share Posted November 12, 2009 Yes -Stuart Link to comment https://forums.phpfreaks.com/topic/181250-if-variable/#findComment-956171 Share on other sites More sharing options...
otuatail Posted November 12, 2009 Share Posted November 12, 2009 Sorry missed that one if ($room='C08') should be if ($room ==' C08') Link to comment https://forums.phpfreaks.com/topic/181250-if-variable/#findComment-956172 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.