Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!


Click here to return to the 'My own version (secure, valid and nice).' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
My own version (secure, valid and nice).
Authored by: androse on Nov 21, '03 07:49:38PM
Okay, this is my version. I saved it as
/Library/WebServer/Documents/index.php
and removed the default apache stuff. Now my co-workers can heckle me via RendezVous :)

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
	<meta http-equiv="content-type" content="text/html; charset=iso-8859-1" />
	<title>Heckle me !</title>
	<style type="text/css">
	
		body {
			padding: 100px 0 0 40px;
			background: #f2f2f2;
			font-family: "Helvetica Neue Light", "Helvetica Neue", Helvetica, Arial, sans-serif;
			font-size: 16px;
			color: #ccc;
		}
		p.output span.green {
			color: #0c0;
		}	
	</style>
</head>
<body>
	<?php
		$voices = array('Agnes', 'Albert', 'Bad News', 'Bahh', 'Bells', 'Boing', 'Bruce', 'Bubbles', 'Cellos', 'Deranged', 'Fred', 'Hysterical', 'Junior', 'Kathy', 'Pipe Organ', 'Princess', 'Ralph', 'Trinoids', 'Vicki', 'Victoria', 'Whisper', 'Zarvox');
		if(strlen($_REQUEST['heckle'])) {
			if(strlen($_REQUEST['voice']) && in_array($_REQUEST['voice'], $voices)) {
				$voice = '-v '.$_REQUEST['voice'].' ';
			} else {
				$voice = '';
			}
			$heckle = escapeshellcmd(stripslashes($_REQUEST['heckle']));
			system('say '.$voice.$heckle.' &');
		
		
			echo '<p class="output">you said :<br />« <span class="green">';
			echo htmlentities($_REQUEST['heckle']);
			echo '</span> »</p>';
		} else {
			echo '<p>Heckle Ned!</p>';
		}
	?>
	
	<form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="post">
		<p><select name="voice" id="voice">
<?php
			foreach($voices as $vox) {
				if($vox == $_REQUEST['voice']) {
					echo "\t\t\t<option selected=\"selected\">$vox</option>\n";
				} else {
					echo "\t\t\t<option>$vox</option>\n";
				}
			}
?>
			</select>
			<input type="text" maxlength="60" name="heckle" id="heckle" />
			<input type="submit" value="HECKLE NED" />
		</p>
	</form>

</body>
</html>


[ Reply to This | # ]
My own version (secure, valid and nice).
Authored by: thecolor on Mar 23, '06 07:30:37AM

I'm curious if anyone is familure with a way to pipe this command through to the visiting clients speakers or preferably the beep speaker. Obviously the voice does not need a serious subwoofer... and the beep speaker is always active.

It works great on my end... but I'd like to pass 'say' sounds to users visiting as well. I've not located any such question on the forum yet (and a difficult one to tailor in Google. ;)

Thanks



[ Reply to This | # ]