Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $wsdl = "http://localhost:8080/TTTWebApplication/TTTWebService?WSDL";
- $trace = true;
- $exceptions = true;
- try {
- $proxy = new SoapClient($wsdl, array('trace' => $trace, 'exceptions' => $exceptions));
- ?>
- <form>
- <input type="button" value="Login" onclick="" />
- </form>
- <form action="register.php">
- <input name="register" type="submit" value="Register"/>
- </form>
- <?php
- } catch (Exception $e) {
- echo $e->getMessage();
- }
- ?>
- <?php
- $wsdl = "http://10.100.106.46:8080/TTTWebApplication/TTTWebService?WSDL";
- $trace = true;
- $exceptions = true;
- try {
- $proxy = new SoapClient($wsdl, array('trace' => $trace, 'exceptions' => $exceptions));
- //form goes here
- echo "
- <form method=\"post\">
- <div>
- <label>First Name</label>
- <input type=\"text\" name=\"fname\">
- </div>
- <div>
- <label>Surname</label>
- <input type=\"text\" name=\"sname\">
- </div>
- <div>
- <label>Username</label>
- <input type=\"text\" name=\"username\">
- </div>
- <div>
- <label>Password</label>
- <input type=\"name\" name=\"password\">
- </div>
- <div>
- <button type=\"submit\" name=\"submit\" value=\"submit\">Create account</button>
- </div>
- </form>
- ";
- echo "
- <p>Already have an account? <a href=\"login.php\">Sign in</a>.</p>
- ";
- if(isset($_POST['submit'])){
- $xml_array["username"]=$_POST["username"];
- $xml_array["password"]=$_POST["password"];
- $xml_array["name"]=$_POST["fname"];
- $xml_array["surname"]=$_POST["sname"];
- $response=$proxy->register($xml_array);
- $val=(string) $response->return;
- if($val=="ERROR-INSERT"|$val=="ERROR-RETRIEVE"|$val="ERROR-DB"|$val="ERROR-REPEAT"){
- //fails
- header("mainScreen.php");
- } else {
- header("mainScreen.php");
- }
- exit;
- }
- } catch (Exception $e) {
- echo $e->getMessage();
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement