magtheterror Posted September 20, 2007 Share Posted September 20, 2007 I recently did a clean install with Mac OS10.4 and all updates, use to have OS10.1.4. Some of my PHP scripts have quit working. Can anyone help. I am attaching the script that generates the second that is not pulling the roomnumber like it use to. <!-- Index Template --> <html> <head> <?php include '../home/header.html' ?> </head> <body bgcolor="#336699" marginheight="0" marginwidth="0" leftmargin="0" rightmargin="0" topmargin="0" background="../images/bg.gif"> <?php include '../menus/top_menu/topmenu.php' ?> <table width="800" border="0" cellspacing="3" cellpadding="0"> <tr> <td width="170" align="left" valign="top"> <form name="form"> <?php include '../classroomfinder/finder.php' ?><img src="../images/spacer.gif" alt="" width="1" height="3" border="0"><?php include '../menus/av_menu/avmenu.html' ?><img src="../images/spacer.gif" alt="" width="1" height="3" border="0"><?php include 'avinfo.html' ?> </form> </td> <td align="center" valign="top"> <br> <p> <table width="550" cellspacing="0" cellpadding="0" border="0"> <tr> <td valign="top"> <font size="3">AV Suppported Classrooms</font><br><br> </td> </tr> <tr> <td> <font size="2">The Audio Visual department provides A/V equipment support for the rooms listed below.</font> </td> </tr> </table> </p> <p> <table width="550" cellspacing="0" cellpadding="0" border="0" bordercolor="black" style="border-style: solid; border-width: 1px 1px 1px"> <tr> <td class="whitetext" width="300" bgcolor="#336699"> Building</td> <td class="whitetext" width="110" bgcolor="#336699" align="center">Room Number</td> <td class="whitetext" width="110" bgcolor="#336699" align="center">Room Capacity</td> <td class="whitetext" width="30" bgcolor="#336699"><img src="../images/spacer.gif" width="20"></td> </tr> <tr> <td class="blacktext" bgcolor="white" width="300" valign="middle"> Hospital/2West Amp </td> <td colspan="3"> <table width="100%" cellspacing="0" cellpadding="0" border="0"> <?php // Default page display // Connect to the database server $dbcnx = @mysql_connect("localhost", "root", "dont you want to know"); if (!$dbcnx) { echo( "<p>Unable to connect to the " . "database server at this time.</p>" ); exit(); } // Select the AV_AvailableEquipment database if (! @mysql_select_db("AV_SupportedRooms") ) { echo( "<p>Unable to locate the Rooms " . "database at this time.</p>" ); exit(); } $result = @mysql_query("SELECT * FROM Rooms where BuildingName = 'Hospital/2West Amp' order by RoomNumber"); if (!$result) { echo("<p>Error performing query: " . mysql_error() . "</p>"); exit(); } ?> <?php // Display the text of each room in a paragraph while ( $row = mysql_fetch_array($result) ) { echo("<tr> <td width=110 class=blacktext align=center bgcolor=white>" . $row[RoomNumber] . "</td> <td width=110 class=blacktext align=center bgcolor=white>" . $row[RoomCapacity] . "</td> <td width=30 class=blacktext align=center bgcolor=#AFCAE4><a href=javascript:StartPic('http://www.ets.musc.edu/classroomfinder/room_generator.php?RoomNumber=" . $row[RoomNumber] . "','" . $row[RoomNumber] . "') style=color:blue><img src=../images/sqr.jpg border=0></a></td> </tr>" ); } ?> </table> </td> </tr> </table> </p> <table width="550" cellspacing="0" cellpadding="0" border="0" bordercolor="black" style="border-style: solid; border-width: 1px 1px 1px"> <tr> <td class="blacktext" bgcolor="white" width="300" valign="top"> Baruch Auditorium </td> <td> <table width="100%" cellspacing="0" cellpadding="0" border="0"> <?php $result = @mysql_query("SELECT * FROM Rooms where BuildingName = 'Baruch Auditorium' order by RoomNumber"); if (!$result) { echo("<p>Error performing query: " . mysql_error() . "</p>"); exit(); } ?> <?php // Display the text of each room in a paragraph while ( $row = mysql_fetch_array($result) ) { echo("<tr> <td width=110 class=blacktext align=center bgcolor=white>" . $row[RoomNumber] . "</td> <td width=110 class=blacktext align=center bgcolor=white>" . $row[RoomCapacity] . "</td> <td width=30 class=blacktext align=center bgcolor=#AFCAE4><a href=javascript:StartPic('http://www.ets.musc.edu/classroomfinder/room_generator.php ?RoomNumber=" . $row[RoomNumber] . "','" . $row[RoomNumber] . "') style=color:blue><img src=../images/sqr.jpg border=0></a></td> </tr>" ); } ?> </table> </td> </tr> </table> <p> <table width="550" cellspacing="0" cellpadding="0" border="0" bordercolor="black" style="border-style: solid; border-width: 1px 1px 1px"> <tr> <td class="blacktext" bgcolor="white" width="300" valign="top"> Basic Science Building </td> <td> <table width="100%" cellspacing="0" cellpadding="0" border="0"> <?php $result = @mysql_query("SELECT * FROM Rooms where BuildingName = 'Basic Science Building' order by RoomNumber"); if (!$result) { echo("<p>Error performing query: " . mysql_error() . "</p>"); exit(); } ?> <?php // Display the text of each room in a paragraph while ( $row = mysql_fetch_array($result) ) { echo("<tr> <td width=110 class=blacktext align=center bgcolor=white>" . $row[RoomNumber] . "</td> <td width=110 class=blacktext align=center bgcolor=white>" . $row[RoomCapacity] . "</td> <td width=30 class=blacktext align=center bgcolor=#AFCAE4><a href=javascript:StartPic('http://www.ets.musc.edu/classroomfinder/room_generator.php?RoomNumber=" . $row[RoomNumber] . "','" . $row[RoomNumber] . "') style=color:blue><img src=../images/sqr.jpg border=0></a></td> </tr>" ); } ?> </table> </td> </tr> </table> </p> <p> <table width="550" cellspacing="0" cellpadding="0" border="0" bordercolor="black" style="border-style: solid; border-width: 1px 1px 1px"> <tr> <td class="blacktext" bgcolor="white" width="300" valign="top"> Cannon Street</td> <td> <table width="100%" cellspacing="0" cellpadding="0" border="0"> <?php $result = @mysql_query("SELECT * FROM Rooms where BuildingName = 'Cannon Street' order by RoomNumber"); if (!$result) { echo("<p>Error performing query: " . mysql_error() . "</p>"); exit(); } ?> <?php // Display the text of each room in a paragraph while ( $row = mysql_fetch_array($result) ) { echo("<tr> <td width=110 class=blacktext align=center bgcolor=white>" . $row[RoomNumber] . "</td> <td width=110 class=blacktext align=center bgcolor=white>" . $row[RoomCapacity] . "</td> <td width=30 class=blacktext align=center bgcolor=#AFCAE4><a href=javascript:StartPic('http://www.ets.musc.edu/classroomfinder/room_generator.php?RoomNumber=" . $row[RoomNumber] . "','" . $row[RoomNumber] . "') style=color:blue><img src=../images/sqr.jpg border=0></a></td> </tr>" ); } ?> </table> </td> </tr> </table> </p> <p> <table width="550" cellspacing="0" cellpadding="0" border="0" bordercolor="black" style="border-style: solid; border-width: 1px 1px 1px"> <tr> <td class="blacktext" bgcolor="white" width="300" valign="top"> Charleston Memorial</td> <td> <table width="100%" cellspacing="0" cellpadding="0" border="0"> <?php $result = @mysql_query("SELECT * FROM Rooms where BuildingName = 'Charleston Memorial' order by RoomNumber"); if (!$result) { echo("<p>Error performing query: " . mysql_error() . "</p>"); exit(); } ?> <?php // Display the text of each room in a paragraph while ( $row = mysql_fetch_array($result) ) { echo("<tr> <td width=110 class=blacktext align=center bgcolor=white>" . $row[RoomNumber] . "</td> <td width=110 class=blacktext align=center bgcolor=white>" . $row[RoomCapacity] . "</td> <td width=30 class=blacktext align=center bgcolor=#AFCAE4><a href=javascript:StartPic('http://www.ets.musc.edu/classroomfinder/room_generator.php?RoomNumber=" . $row[RoomNumber] . "','" . $row[RoomNumber] . "') style=color:blue><img src=../images/sqr.jpg border=0></a></td> </tr>" ); } ?> </table> </td> </tr> </table> </p> <p> <table width="550" cellspacing="0" cellpadding="0" border="0" bordercolor="black" style="border-style: solid; border-width: 1px 1px 1px"> <tr> <td class="blacktext" bgcolor="white" width="300" valign="top"> Clinical Science Building </td> <td> <table width="100%" cellspacing="0" cellpadding="0" border="0"> <?php $result = @mysql_query("SELECT * FROM Rooms where BuildingName = 'Clinical Science Building' order by RoomNumber"); if (!$result) { echo("<p>Error performing query: " . mysql_error() . "</p>"); exit(); } ?> <?php // Display the text of each room in a paragraph while ( $row = mysql_fetch_array($result) ) { echo("<tr> <td width=110 class=blacktext align=center bgcolor=white>" . $row[RoomNumber] . "</td> <td width=110 class=blacktext align=center bgcolor=white>" . $row[RoomCapacity] . "</td> <td width=30 class=blacktext align=center bgcolor=#AFCAE4><a href=javascript:StartPic('http://www.ets.musc.edu/classroomfinder/room_generator.php?RoomNumber=" . $row[RoomNumber] . "','" . $row[RoomNumber] . "') style=color:blue><img src=../images/sqr.jpg border=0></a></td> </tr>" ); } ?> </table> </td> </tr> </table> </p> <p> <table width="550" cellspacing="0" cellpadding="0" border="0" bordercolor="black" style="border-style: solid; border-width: 1px 1px 1px"> <tr> <td class="blacktext" bgcolor="white" width="300" valign="top"> College of Nursing </td> <td> <table width="100%" cellspacing="0" cellpadding="0" border="0"> <?php $result = @mysql_query("SELECT * FROM Rooms where BuildingName = 'College of Nursing' order by RoomNumber"); if (!$result) { echo("<p>Error performing query: " . mysql_error() . "</p>"); exit(); } ?> <?php // Display the text of each room in a paragraph while ( $row = mysql_fetch_array($result) ) { echo("<tr> <td width=110 class=blacktext align=center bgcolor=white>" . $row[RoomNumber] . "</td> <td width=110 class=blacktext align=center bgcolor=white>" . $row[RoomCapacity] . "</td> <td width=30 class=blacktext align=center bgcolor=#AFCAE4><a href=javascript:StartPic('http://www.ets.musc.edu/classroomfinder/room_generator.php?RoomNumber=" . $row[RoomNumber] . "','" . $row[RoomNumber] . "') style=color:blue><img src=../images/sqr.jpg border=0></a></td> </tr>" ); } ?> </table> </td> </tr> </table> </p> <p> <table width="550" cellspacing="0" cellpadding="0" border="0" bordercolor="black" style="border-style: solid; border-width: 1px 1px 1px"> <tr> <td class="blacktext" bgcolor="white" width="300" valign="top"> Quadrangle F </td> <td> <table width="100%" cellspacing="0" cellpadding="0" border="0"> <?php $result = @mysql_query("SELECT * FROM Rooms where BuildingName = 'Quadrangle F' order by RoomNumber"); if (!$result) { echo("<p>Error performing query: " . mysql_error() . "</p>"); exit(); } ?> <?php // Display the text of each room in a paragraph while ( $row = mysql_fetch_array($result) ) { echo("<tr> <td width=110 class=blacktext align=center bgcolor=white>" . $row[RoomNumber] . "</td> <td width=110 class=blacktext align=center bgcolor=white>" . $row[RoomCapacity] . "</td> <td width=30 class=blacktext align=center bgcolor=#AFCAE4><a href=javascript:StartPic('http://www.ets.musc.edu/classroomfinder/room_generator.php?RoomNumber=" . $row[RoomNumber] . "','" . $row[RoomNumber] . "') style=color:blue><img src=../images/sqr.jpg border=0></a></td> </tr>" ); } ?> </table> </td> </tr> </table> </p> <p> <table width="550" cellspacing="0" cellpadding="0" border="0" bordercolor="black" style="border-style: solid; border-width: 1px 1px 1px"> <tr> <td class="blacktext" bgcolor="white" width="300"> Storm Eye Institute </td> <td> <table width="100%" cellspacing="0" cellpadding="0" border="0"> <?php $result = @mysql_query("SELECT * FROM Rooms where BuildingName = 'Storm Eye' order by RoomNumber"); if (!$result) { echo("<p>Error performing query: " . mysql_error() . "</p>"); exit(); } ?> <?php // Display the text of each room in a paragraph while ( $row = mysql_fetch_array($result) ) { echo("<tr> <td width=110 class=blacktext align=center bgcolor=white>" . $row[RoomNumber] . "</td> <td width=110 class=blacktext align=center bgcolor=white>" . $row[RoomCapacity] . "</td> <td width=30 class=blacktext align=center bgcolor=#AFCAE4><a href=javascript:StartPic('http://www.ets.musc.edu/classroomfinder/room_generator.php?RoomNumber=" . $row[RoomNumber] . "','" . $row[RoomNumber] . "') style=color:blue><img src=../images/sqr.jpg border=0></a></td> </tr>" ); } ?> </table> </td> </tr> </table> </p> <p> <table width="550" cellspacing="0" cellpadding="0" border="0" bordercolor="black" style="border-style: solid; border-width: 1px 1px 1px"> <tr> <td class="blacktext" bgcolor="white" width="300" valign="top"> Education Center/Library Building </td> <td> <table width="100%" cellspacing="0" cellpadding="0" border="0"> <?php $result = @mysql_query("SELECT * FROM Rooms where BuildingName = 'Education Center/Library' order by RoomNumber"); if (!$result) { echo("<p>Error performing query: " . mysql_error() . "</p>"); exit(); } ?> <?php // Display the text of each room in a paragraph while ( $row = mysql_fetch_array($result) ) { echo("<tr> <td width=110 class=blacktext align=center bgcolor=white>" . $row[RoomNumber] . "</td> <td width=110 class=blacktext align=center bgcolor=white>" . $row[RoomCapacity] . "</td> <td width=30 class=blacktext align=center bgcolor=#AFCAE4><a href=javascript:StartPic('http://www.ets.musc.edu/classroomfinder/room_generator.php?RoomNumber=" . $row[RoomNumber] . "','" . $row[RoomNumber] . "') style=color:blue><img src=../images/sqr.jpg border=0></a></td> </tr>" ); } ?> </table> </td> </tr> </table> </p> </td> </tr> </table> </body> </html> Second Script that is not picking up the roomnumber: <html> <head> <title>Room Generator</title> <link rel="stylesheet" href="../css/roomgenerator.css" type="text/css"> </head> <body margin="5" topmargin="5" leftmargin="5" rightmargin="5"> <table width="100%" cellpadding="1" cellspacing="0" border="0" bgcolor="black"> <tr> <td valign="top"> <table width=100% cellpadding=2 cellspacing=0 border=0 bordercolor=#000033 bgcolor=white align=center> <tr> <td bgcolor="#336699"><font color="white">Classroom Finder: <?php echo($RoomNumber) ?></font></td> <td bgcolor="#336699"><div align="right"><a href="" onClick="javascript:self.close()" style="color:white"><img src="/images/x.gif" alt="Close Window" border="0"></a></div></td> </tr> <tr> <td bgcolor="#AFCAE4" height="1" colspan="2"><img src="/images/spacer.gif" alt="" width="1" height="1" border="0"></td> </tr> </table> </td> </tr> </table> <table width=100% cellpadding=0 cellspacing=0 border=0 bgcolor=white align=center> <tr><td><img src="/images/spacer.gif" alt="" width="1" height="1" border="0"></td></tr> <?php $dbcnx = @mysql_connect("localhost", "root", "i'll never tell"); if (!$dbcnx) { echo( "<p>Unable to connect to the " . "database server at this time.</p>" ); exit(); } // Select the AV_SupportedRooms database if (! @mysql_select_db("AV_SupportedRooms") ) { echo( "<p>Unable to locate the Rooms " . "database at this time.</p>" ); exit(); } $result = @mysql_query("SELECT * FROM Rooms WHERE RoomNumber='$RoomNumber'"); if (!$result) { echo("<p>Error performing query: " . mysql_error() . "</p>"); exit(); } // Display the text of each room in a paragraph while ( $row = mysql_fetch_array($result) ) { echo("<tr> <td valign=top align=center> <table width=300 cellspacing=0 cellpadding=1 border=0 bgcolor=black> <tr><td><img src=../images/rooms/" . $row[RoomNumber] . ".jpg width=300 height=225 alt=" . $row[RoomNumber] . "></td></tr> </table> </td> <td><img src='/images/spacer.gif' width='1' height='1' border='0'></td> <td valign=top> <table width=100% cellpadding=0 cellspacing=0 border=0 bgcolor=black> <tr> <td valign=top> <table width=100% cellspacing=1 cellpadding=3 border=0> <tr><td valign=top class=whitetext bgcolor=#336699 width=40%>Building Name:</td><td class=blacktext bgcolor=white>" . $row[buildingName] . "</td></tr> <tr><td valign=top class=whitetext bgcolor=#336699>Room Number:</td><td class=blacktext bgcolor=white>" . $row[RoomNumber] . "</td></tr> <tr><td valign=top class=whitetext bgcolor=#336699>Room Type:</td><td class=blacktext bgcolor=white>" . $row[RoomType] . "</td></tr> <tr><td valign=top class=whitetext bgcolor=#336699>Seating Style:</td><td class=blacktext bgcolor=white>" . $row[seatingStyle] . "</td></tr> <tr><td valign=top class=whitetext bgcolor=#336699>Room Capacity:</td><td class=blacktext bgcolor=white>" . $row[RoomCapacity] . "</td></tr> <tr><td valign=top class=whitetext bgcolor=#336699>Computer:</td><td width=60% class=blacktext bgcolor=white>" . $row[Computer] . "</td></tr> <tr><td valign=top class=whitetext bgcolor=#336699>Computer Drives:</td><td class=blacktext bgcolor=white>" . $row[ComputerDrives] . "</td></tr> <tr><td valign=top class=whitetext bgcolor=#336699>Peripherals:</td><td class=blacktext bgcolor=white>" . $row[ComputerPeripherals] . "</td></tr> <tr><td valign=top class=whitetext bgcolor=#336699>Internet Access:</td><td class=blacktext bgcolor=white>" . $row[internetAccess] . "</td></tr> <tr><td valign=top class=whitetext bgcolor=#336699>Laptop Interface:</td><td class=blacktext bgcolor=white>" . $row[LaptopInterface] . "</td></tr> <tr><td valign=top class=whitetext bgcolor=#336699>Video Devices:</td><td class=blacktext bgcolor=white>" . $row[VideoDevices] . "</td></tr> <tr><td valign=top class=whitetext bgcolor=#336699>Screens:</td><td class=blacktext bgcolor=white>" . $row[screens] . "</td></tr> <tr><td valign=top class=whitetext bgcolor=#336699>General:</td><td class=blacktext bgcolor=white>" . $row[General] . "</td></tr> <tr><td valign=top class=whitetext bgcolor=#336699>Outside Communication:</td><td class=blacktext bgcolor=white>" . $row[OutsideCommunication] . "</td></tr> </table> </td> </tr> </table> </td> </tr>" ); } ?> </table> </body> </html> If you want to see it in action go to http://www.ets.musc.edu/av/avsupportedrooms.php click on the 'i' at the end of each classroom line. Again, this worked before the update. TIA Quote Link to comment https://forums.phpfreaks.com/topic/69997-problem-with-script-that-use-to-work/ Share on other sites More sharing options...
trq Posted September 20, 2007 Share Posted September 20, 2007 Sorry to jump straight on your case but firstly... If you going to post code please post it within the code tags povided, these make your code much easier to read. Secondly, narrow the problem down to the relevent code instead of posting an entire script. Most people will simply ignore a huge mass of code. And thirdly, you fail to describe your actual problem. You need to let us know exactly what you expect to happen, what IS happening and what steps YOU have taken to debug the problems. Quote Link to comment https://forums.phpfreaks.com/topic/69997-problem-with-script-that-use-to-work/#findComment-351559 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.