-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathsearch.php
More file actions
56 lines (49 loc) · 1.5 KB
/
search.php
File metadata and controls
56 lines (49 loc) · 1.5 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
<? session_start();?>
<? include("stdio.php"); ?>
<vxml version="2.1"
xmlns="http://www.w3.org/2001/vxml">
<form id="search">
<field name="name">
<grammar type="application/x-gsl" mode="voice">
<![CDATA[ <?php //the php is for the sake of my syntax-hightlighting ?>
[
<?php //this chunk of code populates the grammar from the database
include("connect.php");
$resultat = mysql_query("SELECT name, ID FROM `avxml_entries` ");
while ($raekke = mysql_fetch_array($resultat)) {
extract($raekke);
$name =strtolower($name);
echo "[$name] {<name \"$ID\">}
"; //vxml doesn't like \n, so I have to cheat to get well-formatted output.
}
mysql_close($conn);
?>
]
]]>
</grammar>
<prompt>
<audio src="<?php get_audio(6, "file") ?>"> <!-- asks the user for the name to find -->
<?php get_audio(6, "message") ?>
</audio>
</prompt>
<noinput>
<audio src="<?php get_audio(14, "file") ?>">
<?php get_audio(14, "message") ?>
</audio>
<reprompt />
</noinput>
<nomatch>
<audio src="<?php get_audio(4, "file") ?>">
<?php get_audio(4, "message") ?>
</audio>
<reprompt />
</nomatch>
<filled>
<audio src="<?php get_audio(11, "file") ?>"> <!-- confirms we got the input -->
<?php get_audio(11, "message") ?>
</audio>
<submit next="process.php?type=search" method="post" namelist="name"/>
</filled>
</field>
</form>
</vxml>