passing parameters in url through form action in php functions

user3844830

I am using web services to get the parameter from SOAP client successfully. I want to pass this parameters in url through html form so that i can connect to my system with this parameters. I have 2 functions. Function login() is to set the parameters for the connection from SOAP client and function getVehicle() to get this parameters. In getVehicle() i want to send the parameters user, hash password, dealer_number, corporate_group_id to client.php from url. And this parameters i want to send from form action without submit button.

index.php

    function login()
    {
        $wsdl = 'http://www.schwackenet.de/awonline/de/service2/SNWebService.php?wsdl';
        $options = array('trace' => true);

        $params = array(
          'user' =>               utf8_encode('deshmukh'),
          'password' =>           utf8_encode('deshmukh'),
          'corporate_group_id' => '101',
          'dealer_number' =>      'INT31303',
          'dms_id' =>             'A13T2D19',
          'dms_image_url' =>      '', 
          'dms_keepalive_url' =>  '', 
          'dms_followup_url' =>   ''  
        );

        $client = new SoapClient($wsdl, $options);  
        $result = $client->Login($params);      
        return $return;
    }

if($parameter['aktion'] == 'getVehicle') 
{       
    //var_dump(Login());
    $vehicle=login();
    $user_login=$vehicle['user'];
    $password=$vehicle['password'];
    $dealer_no=$vehicle['dealer_number'];
    $group_id=$vehicle['corporate_group_id'];

//form action here         

    }
Latheesan

You can have the data transferred to your client.php as a GET request using the built-in php function file_get_contents() like this:

if ($parameter['aktion'] == 'getVehicle') 
{       
    $vehicle=login();
    $user_login=$vehicle['user'];
    $password=$vehicle['password'];
    $dealer_no=$vehicle['dealer_number'];
    $group_id=$vehicle['corporate_group_id'];

    // send the data to your system
    $system_url = 'http://yoursite.com/path/to/client.php';
    header("Location: $system_url?user=$user_login&password=$password&dealer_number=$dealer_no&corporate_group_id=$group_id");
    exit();
}

If you want, you can have client.php reurn a "success" or "error" output and you'll have it on the $response variable and you can log it or do something else with it.

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

passing parameters through URL to action using Struts2 taglib

Passing variables in php as paramters through form action on submit

Passing a variable through the form action

Passing multiple parameters through url in android and getting them in PHP

Parameters in form action url disappear?

VBA passing multiple parameters to SQL through functions

passing parameters through url to view django

Passing Two Parameters Through URL in Django

Passing multiple parameters to PHP through AJAX

URL parameters not passing to form in Adobe Experience Manager

Passing through URL parameters through Passport OAuth flow

Passing javascript/Jquery array to php through a form

Passing form values through AJAX to php

Form POST data not passing through to PHP

Sending parameters from Form To Url.Action

Passing url parameters from Url.Action variables in javascript

How to redirect to a Controller/Action passing any URL parameters?

Passing parameters to Unity Action

passing several parameters through url to the same page in ASP MVC & Javascript

Passing functions through classes

Passing functions as parameters in Swift

Passing functions are parameters in RPyC

ReactJS - passing parameters to functions

Yii Sending parameters to index action through page url

Error in sending parameters to controller through @Url.Action in JQuery

MVC ASP.NET Url.Action in form action, passing it form data

Passing a Varible through a form

PHP Session not passing multiple post form data through multiple pages

Can we pass url parameters in form action attribute in Coldfusion?