Forum Moderators: coopster
nusoap.php and verse.php are in the same directory.
Thanks in advance for your assistance!
PAGE CODE is below (line 33 is bold: 'include-audio-link'=>'1')
-------------------------------------------------------------------------
<!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">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Daily Bible Verse</title>
</head>
<body>
<?php
/**
* Display Bible Gateway Verse of the Day.
*/
/* display SOAP errors */
function showErrors( $soapclient, $results ) {
echo 'Request: <xmp>'.$soapclient->request.'</xmp>';
echo 'Response: <xmp>'.$soapclient->response.'</xmp>';
echo 'Debug log: <pre>'.$soapclient->debug_str.'</pre>';
echo $results['faultstring'];
}
/* load NuSOAP library */
require_once('nusoap.php');
/* create new soap client */
$soapclient = new soapclient('http://www.example.com/usage/votd/');
/* set parameter values */
$parameters= array('preferences'=>array('version_id'=>'31',
'utc_offset'=>'-5'),
'options'=>array('include-copyright'=>'both',
'include-url-link'=>'1',
'include-audio-link'=>'1'
)
);
/* call service and get verse of the day */
$results = $soapclient->call('doGetVotd',$parameters);
/* display verse of the day */
if($err = $soapclient->getError()){
showErrors($soapclient, $results);
} else {
print $results;
}
?>
</body>
</html>
[edited by: jatar_k at 12:47 am (utc) on May 9, 2005]
[edit reason] generalized url [/edit]
Your problem is actually on this line
if($err = $soapclient->getError()){
You are using a single = sign which as you know is for variable assignment and not for testing a certain condition which the == does. Add the extra equals and it should work.
Also, the line I've highlighted is actually line 33 of the PHP code. PHP will report the line number in the actual script and not include the HTML.
Deester
ERROR
Parse error: parse error, unexpected T_CONSTANT_ENCAPSED_STRING, expecting ')' in /home/brooking/public_html/bibleVerse/verse.php on line 33
PAGE CODE
<!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">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Daily Bible Verse</title>
</head>
<body>
<?php
/**
* Display Bible Gateway Verse of the Day.
*/
/* display SOAP errors */
function showErrors( $soapclient, $results ) {
echo 'Request: <xmp>'.$soapclient->request.'</xmp>';
echo 'Response: <xmp>'.$soapclient->response.'</xmp>';
echo 'Debug log: <pre>'.$soapclient->debug_str.'</pre>';
echo $results['faultstring'];
}
/* load NuSOAP library */
require_once('nusoap.php');
/* create new soap client */
$soapclient = new soapclient('http://www.example.com/usage/votd/');
/* set parameter values */
$parameters= array('preferences'=>array('version_id'=>'31',
'utc_offset'=>'-5'),
'options'=>array('include-copyright'=>'both',
'include-url-link'=>'1',
'include-audio-link'=>'1'
)
);
/* call service and get verse of the day */
$results = $soapclient->call('doGetVotd',$parameters);
/* display verse of the day */
if($err == $soapclient->getError()){
showErrors($soapclient, $results);
} else {
print $results;
}
?>
</body>
</html>
[edited by: jatar_k at 12:48 am (utc) on May 9, 2005]
[edit reason] generalized url [/edit]