Fatal error: Cannot redeclare class soapclient in /opt/lampp/htdocs/nusoap.php on line 3896
I am sure, even though it says something is wrong with nusoap.php, this is not the case, because I have tried different versions of this file.
This is my server:
Code: Select all
<?php
//include the NuSOAP classes and functions
require_once('nusoap.php');
//create a new soap server using nusoaps soap_server-class
$server = new soap_server();
//getModuleCode can be used to get the module a certain user is taking
//the search is done by ecsUserID
$server->register('getModuleCode');
//connect to database
mysql_select_db('auction', mysql_pconnect('localhost','root','twinsister')) or die (mysql_error());
//method for getModuleCode - this method is used to find the modules a user is taking
function getModuleCode ($ecsID)
{
$sql = "select t.moduleCode
from taking t
where userID = '%$ecsID%'";
$result = mysql_query($sql);
while ($res = mysql_fetch_array($result))
{
$res[] = array ( 'moduleCode' => $res['moduleCode'] );
}//end while
return $res;
}//end function getModuleCode
//start the service
$server->service($HTTP_RAW_POST_DATA);
exit();
?>Code: Select all
<?php
require_once('nusoap.php');
//create a new SOAP client using nusoaps soapclient-class
$client = new soapclient('http://localhost/nusoapServer.php');
$response = $client->call('getModuleCode', "jhs105"); //$user);
//check if there were any matches to the query
if ($response)
{
print "<table border='1'>\n";
print "<tr><th>Module Code </th></tr>";
foreach($response[0] as $row)
{
print "<tr>\n<td>".$row['moduleCode']."</td></tr>\n";
}//end foreach
print "</table>\n";
}//fi
else
{
print "no matches found";
}//esle
?>Thank you,
Jenny