----- Original Message ----- 
From: "Andrew O'Brien"
Subject: [php-list] sound in a php script?


I'm just beginning to try to learn PHP scripts, a friend compiled a
script that works well and uses a form post method to essentially
create an IRC type chat scenario.  A couple of my users would like a
"beep" or some similar audio sound that would alert them when a fresh
line of text arrives on their browser/screen.

Here's an example of what I am dealing with ...

<?php if($cooked == 1) { ?>
<p /><form method="post" action="skccsked.php">
<p>Enter your message here
<input size="50" maxlength="200"  name="text" />
<input type="submit" value="Post"/>
</p>
</form>
<?php } else { echo "<p>You must create an info cookie to post.</p>"; }
?>

Is there an simple command that I could add to the script that would
play a brief "beep" each time the above is executed ?

Andy.
--------------------------
Hello Andy,
                 You can do this with HTML/Javascript. Let me know if this 
script doesn't work and I will debug it for you. Best to use a .mid for 
sound but a .wav should be ok for most browsers.
<head>
<script type="javascript">
// <!--
function beep()
  {
  var body = getElementByTagName("body");
  body.bgsound = "beep.mid";
  }
 // -->
</script>
</head>
<body>
<input name="incoming test" onChange="beep()" type="text">
... 

Reply via email to