I am currently in the process of creating a windows 8 application using C# and I need to access a php file from a website which has a function loginUser($userParam, $passParam) that handles user login into a database. Any hints on how this can be done? Should I use HttpRequest or is there another method?
You need to pass $userParam and $passParam via GET or POST query and call this function in your PHP script, like
echo loginUser($_REQUEST['userParam'], $_REQUEST['passParam']);
You can make GET or POST request with WebRequest, for example:
http://msdn.microsoft.com/en-us/library/0aa3d588%28v=vs.110%29.aspx
Related
I'd like to load and execute a Javascript function in external Javascript file using Node.js and similarly retrieve back with desired result after execution. Is it possible/not possible? If not, any other alternatives.
Any help regarding this is greatly appreciated.
Yes, you can load another JS file as a module using Node.js module system and function require. There's quite good description of how to do it in Node.js documentation, take a look int this page.
Basically you have to load your external file calling function require and passing path to that file:
var externalFunction = require('./path/to/external/file')`;
but to make this work you have to export that function by writing something like
module.exports = functionToExport;
in your external file, where functionToExport is the name of the function which you want to use.
I am tasked to create a web service call where the input looks like this:
<own:AuthenticateMember>
<own:request>
<own1:SecurityToken>9415CD31-0C7E-40AB-A45F-D3538B98D96D</own1:SecurityToken>
<own2:MembershipNumber>200103407801</own2:MembershipNumber>
</own:request>
</own:AuthenticateMember>
The actual values (SecurityToken and MembershipNumber) are PHP request variables.
As you see, it contains namespaces. How would I go about successfully creating this xml request via PHP Soap? Please help me.
I am trying to call via Html.I have tried this
<a href='+2000000200200'>Please Click to Call</a>
Now when I click on this , it opens the the dialer having this number and then I press call and it initiates the call.
Now the thing I am trying to do is When I click the link , it automatically initiate the call.I mean the step of Dialler open and pressing call must be skip.So whenever I click the link it should start making call
Is it possible to do like this?I Really need experts advice about this
Thanks
Sorry is not possible and is inteend to be that way. Making the call needs a 3rd application and ofc you wouldnt want anyone making calls or even by mistake a call being made by just clicking.
You can write a custom protocol handler for this type of thing, but the handler obviously needs to be installed on the machine using it.
Check this stackoverflow thread for custom protocol handling in ios and android.
Custom protocol handling windows
Using C#, register registry keys:
RegistryKey Key = Registry.ClassesRoot.CreateSubKey("test");
Key.CreateSubKey("DefaultIcon").SetValue("", "caller.exe,1");
Key.SetValue("", "call:Protocol");
Key.SetValue("URL Protocol", "");
Key.CreateSubKey(#"shell\open\command").SetValue("", "caller.exe %1");
Caller.exe being your handler:
using System;
using System.Collections.Generic;
using System.Text;
class Program
{
static void Main(string[] args)
{
// args[0] contains the phone number
}
}
Finally:
Call Number
I used the code from http://angularjs.org/ (Wire up a Backend)
Here in project.js
angular.module('project', ['firebase']).
value('fbURL', 'https://angularjs-projects.firebaseio.com/').
factory('Projects', function(angularFireCollection, fbURL) {
return angularFireCollection(fbURL);
}).
config(function($routeProvider) {
I used this code in my web page. Instead of https://angularjs-projects.firebaseio.com/ url i want to use my url i.e http://test.com/test.php. But it didn't work.
Also i want to know in my php file in which format the out put should be?
Do you need to echo the content in php file or use the return command? Please give suggestion. I have searched a lot. I couldn't find the solution.
I think in firebase url https://angularjs-projects.firebaseio.com/ they are returning the response from their back-end service. That is why it didn't worked for you even if you changed the URL.
And answer to your second question;
If you make a call to your back-end service its better to have a json response style from your PHP and you don't have to use any return command for that. Instead you should echo your contents.
For example in your PHP file if you are getting the results as an array you can give back the response to the angular application as;
echo json_encode($result_array);
Hope it helps.
I think you should separate backend and frontend and treat them as two separated application. Both apps should communicate with each other by sending ajax request (front) and respone data in json format (backend). In my opinion it's the best way to handle this.
I want to access some function written in some php file on another server and receive the input, I have access to those server files so that I can change them for proper configuration, I have all the privilleges to do so, can anybody please guide me how can I do it, thank you
$result = file_get_contents("http://some.server/out.php");
and in this out.php
<?php
include 'some.php';
function();
I think you can implement web service or an api, and the output could be in xml or json read the content and use it on your website.
It is just Facebook graph API using URL
https://graph.facebook.com/Pepsi
The above link will fetch information regarding Facebook page of Pepsi.