Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8725185
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T07:59:04+00:00 2026-06-13T07:59:04+00:00

Below i have written code of a soap webservice in php with its client,It

  • 0

Below i have written code of a soap webservice in php with its client,It is working fine, actually m new to php so don’t know how to post data to my server php service from html page, i know by using javascript it is possible but how…..any help by code or helpful link will be appreciated.

<?php
require_once "lib/nusoap.php";

function getProd($username,$password) {
   $user = "root";  
$pswd = "root";  
$db = "LOGIN";  
$conn = mysql_connect('localhost', $user, $pswd);  
mysql_select_db($db, $conn);  
//run the query to search for the username and password the match  
$query = "SELECT * FROM PEOPLE WHERE USERNAME = '$username' AND PASSWORD = '$password'";  
$result = mysql_query($query) or die("Unable to verify user because : " . mysql_error());  
//this is where the actual verification happens  
if(mysql_num_rows($result) > 0)  
  $valid="LoginSucessful";
  else
  $valid="LoginFailed";
  return $valid;
}

$server = new soap_server();
$server->configureWSDL("productlist", "urn:productlist");

$server->register("getProd",
    array("username" => "xsd:string","password" => "xsd:string"),    
    array("return" => "xsd:string"),
    "urn:productlist",
    "urn:productlist#getProd",
    "rpc",
    "encoded",
    "Get a listing of products by category");

if ( !isset( $HTTP_RAW_POST_DATA ) ) $HTTP_RAW_POST_DATA =file_get_contents( 'php://input' );
$server->service($HTTP_RAW_POST_DATA);





  #client of service#

 <?php
require_once "lib/nusoap.php";
$client = new nusoap_client("http://localhost/expa/productlis.php");
$result = $client->call("getProd",array("category" => "admin","item" => "admin"));



Overall just need to pass parameter to the php function.
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T07:59:05+00:00Added an answer on June 13, 2026 at 7:59 am

    There are few ways to get data from the user:

    Pass data via url parameters:

    <a href="index.php?foo=bar">Foo equals Bar</a>
    
    <?php 
    
        $foo = (isset($_GET['foo'])) ? $_GET['foo'] : 'undefined';
    
        echo "foo equals $foo";
    ?>
    

    A straight up form:

    // index.php
    // An example form that loops back to itself.
    <form action="index.php" method="post" id="the_demo_form">
        <fieldset>
            <label for="foo">Foo</label>
            <input type="text" name="foo">  
        </fieldset>
        <input type="submit"/>
    </form>
    <pre>
    <?php
        // the $_POST global contains the data sent in the request.
        var_dump($_POST);
     ?>
    </pre>
    

    Ajax
    If you need to submit the data without reloading via javascript the page you would use AJAX.
    This is an example using jQuery that catches the form submit event and sends the form without reloading the page.

    // index.php
    // An example form
    <form action="index.php" method="post" id="the_demo_form">
        <fieldset>
            <label for="foo">Foo</label>
            <input type="text" name="foo">  
        </fieldset>
        <input type="submit"/>
    </form>
    
    <script>
     $(document).ready(function(){
        $("#the_demo_form").submit(function(event){ 
            // This prevents the browser from following the form.
            event.preventDefault();
            // We take the data and send it to server via AJAX.
            $.ajax({
                // set this to server side script
                url : "index.php",
                data : $(this).serialize(),
                success: function(data){
                    alert("eureka!");
                }
            });
        });
    });
    </script>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have written below code in htaccess RewriteRule ^([a-zA-Z_-]+).php$ http://www.domain.com/myfile.php?page=inc- $1.php [NC] I don't
I have written a very simple WCF service, that worked fine (code below), then
I have written code below.but it will print this exception and i really don't
I am a newbie in PHP and MySQL i have written the code below
Hi I have written below code function unique(th){ var obj = {}; for(var i
I am trying to fetch wcf service from jquery. I have written below code
I have written grammar for a language (sample code below) //this is a procedure
I have written a MapReduce program, code is below: import java.io.IOException; import java.util.Iterator; import
I have written below code to check for blank value in my textbox but
I have written code to TryParse enum either by value or by its name

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.