Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Warning: Uncaught SoapFault exception: [HTTP] Error Fetching http headers in soapclient.php Stack trace: #0
- [internal function]: SoapClient->__doRequest('__call('addUser', Array) #2 {main} thrown in soapclient.php
- Fatal error: Maximum execution time of 30 seconds exceeded in soapclient.php on line 30
- <?php
- $first_name = $_POST['first_name'];
- $last_name = $_POST['last_name'];
- $username = $_POST['username'];
- $password = md5($_POST['password']);
- $options = array('location' => "http://localhost/fellotest/soap/soap_client.php",
- 'uri' => 'http://localhost',
- 'trace'=>1);
- ini_set('default_socket_timeout', 120)
- try{
- $client = new SoapClient(null, $options);
- $client->addUser($first_name, $last_name, $username, $password);
- }
- catch(SoapFault $ex){
- echo "FAULT </br>";
- var_dump($client->__getLastRequest());
- var_dump($client->__getLastResponse());
- var_dump($ex);
- }
- ?>
- <?php
- include('helperssecurity.php');
- include('includessharedez_sql_core.php');
- include('includesmysqliez_sql_mysqli.php');
- // Setting up Soap Service
- $options = array('uri' => 'http://localhost');
- $server = new SoapServer(null, $options)
- //connecting and adding a user to database
- function addUser($first_name, $last_name, $username, $password){
- // For security reasons
- $info = new security();
- // Connect to database
- $db = new ezSQL_mysqli($info::$user, $info::$password, $info::$dbName, $info::$host);
- if(!$db){
- die('Could not connect to database');
- }
- // add user to database
- $insert = $db->query("INSERT INTO `user`(`first_name`, `last_name`, `username`, `password`) VALUES ('$first_name', '$last_name', '$username', '$password')");
- if(!$insert){
- echo "Error while registering";
- }
- else{
- echo "Register Successful";
- }
- }
- // To handle client
- $server->handle();
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement