PHWinfo banniere

Titres
PORTAIL ANNUAIRE ARTICLES COMPARATEUR HÉBERGEURS DEVIS FORUMS RÉDUCTEUR D'URL
Précédent   PHWinfo > Autres forums > Forum Programmation & Conception > comp.lang.php > CURL communication protocol
S'inscrire FAQ Membres Recherche Messages du jour Marquer les forums comme lus
CURL communication protocol

Réponse
 
LinkBack Outils de la discussion
Vieux 20/01/2008, 13h11   #1
Paul Lautman
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut CURL communication protocol

I need to get some data from a MSSQL database via an asp server, to display
in a php generated page. I don't want to pre-format the data from a display
pov, as that means going to the asp server whenever I want to change it.

This data will be a few information fields (e.g. total_number_of_rows_found,
number_of_rows_per_page, current_page_number) plus the columns/rows actually
returned by the query (I guess I really only need to know
total_number_of_rows_found as I will be supplying the other information as
input parms, but this gives the general idea).

I am pleasantly in the exact opposite situation as normally found here, in
that I can control the sending asp script as well as the receiving php one
(although, whilst I may not be anywhere near an expert php programmer, my
php/MySQL skills far outweigh my asp/MSSQL ones!).

An obvious choice of communications protocol is xml, but does anyone have
any other ideas of neat ways to package up the data at the asp end, to make
it easy to access over on the php side?


  Réponse avec citation
Vieux 20/01/2008, 13h50   #2
Jerry Stuckle
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: CURL communication protocol

Paul Lautman wrote:
> I need to get some data from a MSSQL database via an asp server, to display
> in a php generated page. I don't want to pre-format the data from a display
> pov, as that means going to the asp server whenever I want to change it.
>
> This data will be a few information fields (e.g. total_number_of_rows_found,
> number_of_rows_per_page, current_page_number) plus the columns/rows actually
> returned by the query (I guess I really only need to know
> total_number_of_rows_found as I will be supplying the other information as
> input parms, but this gives the general idea).
>
> I am pleasantly in the exact opposite situation as normally found here, in
> that I can control the sending asp script as well as the receiving php one
> (although, whilst I may not be anywhere near an expert php programmer, my
> php/MySQL skills far outweigh my asp/MSSQL ones!).
>
> An obvious choice of communications protocol is xml, but does anyone have
> any other ideas of neat ways to package up the data at the asp end, to make
> it easy to access over on the php side?
>
>
>


Paul,

I've found xml is about the best for things like this.

I implemented something similar for a non-profit a while back. Their
local chapters needed access to a subset of the database, but they
didn't want to make the database accessible via the internet. So I just
built some xml2 pages for them to fetch and supplied some cURL code for
them to get what they wanted. The DOM functions in PHP allowed them to
parse the data as they wished.

The only real problem was building "well-formed" xml. I didn't find any
good tools for VBScript for building the xml, but it wasn't all that hard.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================

  Réponse avec citation
Vieux 20/01/2008, 14h15   #3
Paul Lautman
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: CURL communication protocol

Jerry Stuckle wrote:
> Paul Lautman wrote:
>> I need to get some data from a MSSQL database via an asp server, to
>> display in a php generated page. I don't want to pre-format the data
>> from a display pov, as that means going to the asp server whenever I
>> want to change it.
>> This data will be a few information fields (e.g.
>> total_number_of_rows_found, number_of_rows_per_page,
>> current_page_number) plus the columns/rows actually returned by the
>> query (I guess I really only need to know total_number_of_rows_found
>> as I will be supplying the other information as input parms, but
>> this gives the general idea).
>> I am pleasantly in the exact opposite situation as normally found
>> here, in that I can control the sending asp script as well as the
>> receiving php one (although, whilst I may not be anywhere near an
>> expert php programmer, my php/MySQL skills far outweigh my asp/MSSQL
>> ones!).
>> An obvious choice of communications protocol is xml, but does anyone
>> have any other ideas of neat ways to package up the data at the asp
>> end, to make it easy to access over on the php side?
>>
>>
>>

>
> Paul,
>
> I've found xml is about the best for things like this.
>
> I implemented something similar for a non-profit a while back. Their
> local chapters needed access to a subset of the database, but they
> didn't want to make the database accessible via the internet. So I
> just built some xml2 pages for them to fetch and supplied some cURL
> code for them to get what they wanted. The DOM functions in PHP
> allowed them to parse the data as they wished.
>
> The only real problem was building "well-formed" xml. I didn't find
> any good tools for VBScript for building the xml, but it wasn't all
> that hard.


Good old Microsoft (one doesn't often have a reason to say that!) has got
the best summary of that that I have found:
http://support.microsoft.com/kb/281099

I was sort of wondering about a JSON style protocol, only in php speak,
except that that would I guess entail an eval(), which maybe isn't the best
approach.


  Réponse avec citation
Vieux 20/01/2008, 14h20   #4
Jerry Stuckle
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: CURL communication protocol

Paul Lautman wrote:
> Jerry Stuckle wrote:
>> Paul Lautman wrote:
>>> I need to get some data from a MSSQL database via an asp server, to
>>> display in a php generated page. I don't want to pre-format the data
>>> from a display pov, as that means going to the asp server whenever I
>>> want to change it.
>>> This data will be a few information fields (e.g.
>>> total_number_of_rows_found, number_of_rows_per_page,
>>> current_page_number) plus the columns/rows actually returned by the
>>> query (I guess I really only need to know total_number_of_rows_found
>>> as I will be supplying the other information as input parms, but
>>> this gives the general idea).
>>> I am pleasantly in the exact opposite situation as normally found
>>> here, in that I can control the sending asp script as well as the
>>> receiving php one (although, whilst I may not be anywhere near an
>>> expert php programmer, my php/MySQL skills far outweigh my asp/MSSQL
>>> ones!).
>>> An obvious choice of communications protocol is xml, but does anyone
>>> have any other ideas of neat ways to package up the data at the asp
>>> end, to make it easy to access over on the php side?
>>>
>>>
>>>

>> Paul,
>>
>> I've found xml is about the best for things like this.
>>
>> I implemented something similar for a non-profit a while back. Their
>> local chapters needed access to a subset of the database, but they
>> didn't want to make the database accessible via the internet. So I
>> just built some xml2 pages for them to fetch and supplied some cURL
>> code for them to get what they wanted. The DOM functions in PHP
>> allowed them to parse the data as they wished.
>>
>> The only real problem was building "well-formed" xml. I didn't find
>> any good tools for VBScript for building the xml, but it wasn't all
>> that hard.

>
> Good old Microsoft (one doesn't often have a reason to say that!) has got
> the best summary of that that I have found:
> http://support.microsoft.com/kb/281099
>
> I was sort of wondering about a JSON style protocol, only in php speak,
> except that that would I guess entail an eval(), which maybe isn't the best
> approach.
>
>
>


No, I looked into json and decided it wasn't as good - at least for my
project.

The other option I considered was a CSV file. It would have worked for
the time being as all of the data was related - and could easily be
expressed in a spreadsheet, for instance.

But I was afraid perhaps later they would want other data. The xml is
more flexible and would allow that.

And thanks for the link - it's very similar to what I did. I've
actually done a fair amount of VBScript code (although I'm no where near
an expert), so it wasn't hard.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================

  Réponse avec citation
Vieux 20/01/2008, 20h21   #5
Paul Lautman
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: CURL communication protocol

Jerry Stuckle wrote:
> No, I looked into json and decided it wasn't as good - at least for my
> project.
>
> The other option I considered was a CSV file. It would have worked
> for the time being as all of the data was related - and could easily
> be expressed in a spreadsheet, for instance.
>
> But I was afraid perhaps later they would want other data. The xml is
> more flexible and would allow that.
>
> And thanks for the link - it's very similar to what I did. I've
> actually done a fair amount of VBScript code (although I'm no where
> near an expert), so it wasn't hard.


Did you ever try the aspxml object
(http://www.example-code.com/asp/xmlCreate.asp and
http://www.xml-training-guide.com/a-xml-articles23.html) or the ADODB.Stream
method (http://www.xoc.net/works/tips/getxml.asp). MS doesn't seem to even
mention the former on their site.




  Réponse avec citation
Réponse


Outils de la discussion

Règles de messages
Vous ne pouvez pas créer de nouvelles discussions
Vous ne pouvez pas envoyer des réponses
Vous ne pouvez pas envoyer des pièces jointes
Vous ne pouvez pas modifier vos messages

Les balises BB sont activées : oui
Les smileys sont activés : oui
La balise [IMG] est activée : oui
Le code HTML peut être employé : non
Trackbacks are oui
Pingbacks are oui
Refbacks are oui


Fuseau horaire GMT +1. Il est actuellement 19h22.


Édité par : vBulletin® version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC5 Tous droits réservés.
Version française #16 par l'association vBulletin francophone
PHWinfo est un site Éducation Sans Frontières ©2000-2008
Ad Management by RedTyger
©Tous droits réservés par les parties respectives
Page generated in 0,15320 seconds with 13 queries