0

I'm retrieving some userdata from a phpbb3 forum through scripts on the server. My database does not allow for external login, so I have to go through some kind of script.

But, I'd like to know if there is a safe enough way to retrieve this data? I know how to output some XML with echo statements, but I'm not sure if this is as secure as it should be?

Optimal method would be (psuedo code)

$array['user_id'] = $id;
$array['otherinfo'] = $var

return $array;

if I could somehow read this array with C#, it would be much easier, but I'm not sure how this would work with WebResonses or whatnot.

Any ideas?

2 Answers 2

1

You need a web service, that will output your responses in some format that you can parse with C#.

Php and C# are not interoperable, that s why you will need to create a service that you can consume these messages.

First option as I said is to create a web service, that C# code can consume. In this case, your C# code should know what to ask from your php web service, and you will respond to the request, in XML, or JSON or whatever format you want to use within your C# code to parse it.
Another option is to push the data to a web service that uses C#. You need to write a WCF/ Web service, and you can push the data to this service.

Sign up to request clarification or add additional context in comments.

2 Comments

Ok, i'm sure that is a tidy way to get it done. Although, I'm not really familiar with either. Would these be run by my server and in turn be able to connect to the database? In example..
yeah, you need to host them on your web service.
0

I suggest you to give your array output as xml or json. If we take xml as consideration, you can call the php file which gives xml output like this:

XDocument.Load("http://whatever.com/whatever.php");

And ofc you need to add the System.Xml.Linq header to use XDocument class. And also you can pass a hashed key, etc. from query string to validate the requested is coming from your app.

2 Comments

Alright, I'll give this a shot first, as it requires less work to test out quickly. Thanks so far
@Garrador i hope it helps you.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.