Location: PHPKode > scripts > PHP Voice > php-voice/samples/subdb_mod.php
<?php

/**
 * Sample usage of the SubDialog class 
 *
 * @author Mark Headd  <hide@address.com>
 * @changes rewritten for compatibilities with the new vxml module loader
 * $ version 1.0.0 Fri Nov 05 05:45:31 CET 2004 05:45:31 by hatem
 */

 require_once("../vxml.class.php");
 
// Name for subdialog
$name = "result";

// Location of subdialog form
$src = "subbie";

//Create parameter array
$params = array('fname'=>"Josh", 'lname'=>"Turner");

// Create grammar for subdialog (to keep this simple, use buitin date type
$grammar = "builtin:grammar/date";

// Create prompt for subdialog
$prompt = "Please state your date of birth ".$params['fname']." ".$params['lname'].".";

$page = new gonx_vxml;
$page->start_vxml("", "", "", "", "", "2.0");
$page->start_form("intro");
$page->start_block();
$page->start_prompt("false");
$page->write("Hello, ".$params['fname']." ".$params['lname'].". This is a test to see how a subdialog works.");
$page->end_prompt();
$page->end_block();

$page->load("subdb::call",array($name, $src, $params));
//$page->subdb_call($name, $src, $params);

$page->start_block();
$page->start_prompt("false");
$page->write("The date of birth given was, ");

$page->start_value("$name.dob");
$page->write(".");
$page->end_prompt();
$page->end_block();
$page->end_form();

$page->load("subdb::form",array($src, $params, "Field1", $grammar, $prompt, "dob"));
//$page->subdb_form($src, $params, "Field1", $grammar, $prompt, "dob");

$page->end_vxml();

$page->generate();
 
?>
Return current item: PHP Voice