I know it's a lot of code but it's below. Again, when I have the /* MUSIC? */ section as a standalone file (making sure to open and close the database and include the correct require statements) it works fine; however, when added to the code below (music section 4 paragraphs down) it doesn't play but all the <embed> tags and echo statements are displaying correctly.
Any clues to keep me from banging my head against the wall? ====================================== <?php require($_SERVER['DOCUMENT_ROOT']."/tgwedding/configuration.inc"); require(SITEROOT."/mysql_connect.php"); require(SITEROOT."/finduserID.php"); $query = "SELECT TO_DAYS(weddingDate) - TO_DAYS(SYSDATE()), couplesName FROM customers WHERE customers.customerID='$ID'"; $result = @mysql_query($query); $row = mysql_fetch_array($result, MYSQL_NUM);//store this record as an array "row" $query_preferences = "SELECT bridalpartyMessage FROM preferences WHERE customerID='$ID'"; $result_preferences = @mysql_query($query_preferences); $row_preferences = mysql_fetch_array($result_preferences, MYSQL_NUM);//store this record as an array "row" /* MUSIC? */ $query_music = "SELECT playMusic, songSelection, musicFile FROM preferences WHERE customerID='$ID'"; $result_music = @mysql_query($query_music); $row_music = mysql_fetch_array($result_music, MYSQL_NUM);//store this record as an array "row" echo $row_music[0]; if ($row_music[0] == 1) { // play music if ($row_music[1] == "s") { echo $row_music[1]; echo $row_music[2]; echo '<embed src="songs/'.$row_music[2].'" hidden=true autostart=true loop=true> <noembed> <bgsound src="songs/'.$row_music[2].'" loop=infinite> </noembed>'; } else { echo '<embed src="'.MUSICDIRECTORY.$row_music[2].'" hidden=true autostart=true loop=true> <noembed> <bgsound src="'.MUSICDIRECTORY.$row_music[2].'" loop=infinite> </noembed>'; } } /* MUSIC? */ ?> <html> <head> <?php echo '<title>'.$row[1].'\'s Wedding Website'.'</title>'; ?> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <link href="stylesheet.css" rel="stylesheet" type="text/css"> </head> <body> <div align="center"> <table width="725" border="0" cellpadding="20" cellspacing="0" class="brideandgroom"> <!--DWLayoutTable--> <tr> <?PHP require("headerimage.php"); ?> <div align="right"> <?php echo $row[1]; ?> </div></td> </tr> </table> <table width="725" border="0" cellpadding="0" cellspacing="0" bgcolor="#FFDFDF" class="daysuntilwedding"> <!--DWLayoutTable--> <tr> <td width="16" height="25"> </td> <td width="300" valign="middle"> <?PHP $today = date("l F jS, Y"); echo $today; ?> </td> <td width="14"> </td> <td width="382" align="right" valign="middle"> <?php require(SITEROOT."/daystowedding.php"); ?> </td> <td width="13"> </td> </tr> </table> <table width="725" border="0" cellpadding="0" cellspacing="0"> <!--DWLayoutTable--> <tr> <td height="5" colspan="2" valign="top"><table width="100%" border="0" cellpadding="0" cellspacing="0" class="firstthinstrip"> <!--DWLayoutTable--> <tr> <td width="725" height="5"></td> </tr> </table></td> </tr> <tr> <td height="5" colspan="2" valign="top"><table width="100%" border="0" cellpadding="0" cellspacing="0" class="secondthinstrip"> <!--DWLayoutTable--> <tr> <td width="725" height="5"></td> </tr> </table></td> </tr> <tr> <td width="172" height="400" valign="top"><table width="100%" height="100%" border="0" cellpadding="0" cellspacing="0" bordercolor="#99CCFF" bgcolor="#CEE7FF" class="pinkborderlrb"> <!--DWLayoutTable--> <tr> <td width="172" height="395" valign="top"> <?PHP require("showlists.php"); ?> </td> </tr> </table></td> <td width="553" valign="top"><table width="100%" height="100%" border="0" cellpadding="20" cellspacing="0" bgcolor="#CEE7FF" class="pinkborderrb"> <!--DWLayoutTable--> <tr> <td width="508" height="395" valign="top"><div align="center"> <?php echo '<img src="images/header_bridalparty.gif">'; ?> <?php echo '<p>'.$row_preferences[0].'</p>'; echo '<p><font size=1>Sorted by first name:</font></p>'; ?> <?PHP $query_lists = "SELECT position, firstName, lastName, story, theirPhoto FROM mentions WHERE customerID='$ID' ORDER BY firstName ASC"; $result_lists = @mysql_query($query_lists); // $row_lists = mysql_fetch_array($result_lists, MYSQL_NUM); while ($row_lists = mysql_fetch_array($result_lists, MYSQL_NUM)) { if (!empty($row_lists[1]) || !empty($row_lists[2])) { $list_person = '<tr><td colspan="2"><strong>'.$row_lists[1].' '.$row_lists[2].'</strong></td></tr>'; } else $list_person = null; if (!empty($row_lists[0])) { $list_position = '<tr><td colspan="2"><em><font size="2">'.$row_lists[0].'</font></em></td></tr>'; } else $list_position = null; if (!empty($row_lists[3])) { $list_story = '<tr><td width="22%" valign="top">Story:</td><td width="78%">'.$row_lists[3].'</td></tr>'; } else $list_story = null; if (!empty($row_lists[3])) { $storyYN = "<u>".$row_lists[1] ."'s Story:</u>"; } else { $storyYN = null; } if (!empty($row_lists[4]) || !empty($row_lists[3])) { $theirphoto = '<img src="http://' . $_SERVER['HTTP_HOST'] . '/tgwedding/users/client' . $ID . '/bridalparty/'.$row_lists[4].'" align="left">'; $list_photo = '<tr><td width="70%" valign="top">'.$storyYN.'<br>'.$row_lists[3].'</td><td>'.$theirphoto.'</td>< /tr>'; } else $list_photo = null; echo '<table width="80%" border="0" align="center" cellpadding="0" cellspacing="3" class="itembackground">'.$list_person.$list_position. '<tr> <td> </td> </tr>' // .$list_story. .$list_photo. '</table> <br>'; } ?> </div> <p> </p></td> </tr> </table></td> </tr> </table> <?php require("websitefooter.php"); ?> <?PHP mysql_close(); ?> </div> </body> </html> -----Original Message----- From: Jay Blanchard [mailto:[EMAIL PROTECTED] Sent: Wednesday, May 12, 2004 2:20 PM To: Ryan Schefke; Php-General-Help Subject: RE: [PHP] Strange music playing behavior [snip] I'm getting some strange behavior trying to play music. The script below works fine standalone. However, when I put it into a larger script the music doesn't play but all of the echo statements work and when I view the source the <embed> tags are fine, etc. What could the issue be? If you need me to send the larger file let me know. [snip] Since the code snippet you sent works I would have to say that something about this code being plugged into other code is a problem. I believe that is what it is. For sure. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php