Diese Seite mit anderen teilen ...

Informationen zum Thema:
Forum:
WinDev Forum
Beiträge im Thema:
6
Erster Beitrag:
vor 3 Jahren
Letzter Beitrag:
vor 3 Jahren
Beteiligte Autoren:
cardcoder, Fabrice Harari

[WB17] phpexecute

Startbeitrag von cardcoder am 19.06.2015 00:29

Hi Guys,

The following works from the address bar of chrome.
http://www.betterledlighting.co.uk/UK/tge_xml.php
(it reads an xml file and calls a soap server AND writes the results to a mysql table).

I want to call this php script from my webpage.

This is the button code that I am using to test with -

xmlstring is string

xmlstring = StringBuild(Static3, ws_tge_accountKey, ws_tge_heights, ws_tge_widths, ws_tge_lengths, ws_tge_statedWeight, ws_tge_dimensionUnit, ws_tge_weightUnit, ...
ws_tge_fromCountryIso, ws_tge_fromCity, ws_tge_fromPostcode, ws_tge_toCountryIso, ws_tge_toCity, ws_tge_toPostcode, ...
ws_tge_itemType, ws_tge_requiredCover,ws_tge_IPaddress)

Static3=xmlstring

Res=fSaveText("ma_tge.xml", Static3)
Info("RES : "+ Res)

s is string
s = PHPExecute("tge_xml.php")

ws_int is int
FOR ws_int = 1 TO 1000000
ws_int++
END

The xml file is being create correctly BUT ...
The phpexecute is not working. For what ever reason, it is not being run.

I am nearly there - so any final help is really appreciated.

Regards,

Mike Allison

Antworten:

Hi Mike,

why don't you use the whole URL? I mean

s = PHPExecute("http://www.betterledlighting.co.uk/UK/tge_xml.php";)

Best regards

von Fabrice Harari - am 19.06.2015 01:13
Hi Fabrice,

Thanks for your rapid response .... we are nearly there BUT

PHPExecute finishes before the php script has completed - DOES NOT process.

PHPDisplay("http://www.betterledlighting.co.uk/UK/tge_xml.php";) DOES go to the web page and process the full script!

The problem is that I then need to get back to my web page. How do I do it?

Kindest Regards,

Mike Allison

von cardcoder - am 19.06.2015 13:11
Hello Mike

the only reason I cansee for this behavior is if the php script is running some browser side code (which, for this kind of process, is strange)... Do you have access to it? Can you make sure it does all that it needs to do in server code (in the page init)?

Best regards

von Fabrice Harari - am 19.06.2015 13:38
Hi Fabrice,

It is currently as a seperate script. The script inserts the xml fields into a php array and then converts the array into an xml script that the soap process can handle (nusoap.php).

It waits for the response and converts the xml back into a php array.
I then insert the responses into a mysql table using auto increment and a field for the users IP. This then gives me a list of relevant shipping quotes so the customer can choose the one that they want.

Will it work to put the script into a php page in the init ? Not something I thought of.

Mike

von cardcoder - am 19.06.2015 13:50

Re: [WB17] phpexecute SOLVED

Hi Fabrice,

For your information (and anybody else of course), I have made it work.

I made a fresh page with global variables and created the xml file.
PHPDisplay the php script that I had to call (phpdisplay tge_xml.php). Guarantees that the full script will be executed.
NB
Added the after execution page (fully qualified) as the first line of the php script. Apparently it has to be done this way so it will complete and redirect.
Carried on the processes as normal in the new page showing the data by reading the mysql database.

I have code snippets if anybody can use them.

Kindest Regards,

Mike Allison

von cardcoder - am 22.06.2015 20:09
Zur Information:
MySnip.de hat keinen Einfluss auf die Inhalte der Beiträge. Bitte kontaktieren Sie den Administrator des Forums bei Problemen oder Löschforderungen über die Kontaktseite.
Falls die Kontaktaufnahme mit dem Administrator des Forums fehlschlägt, kontaktieren Sie uns bitte über die in unserem Impressum angegebenen Daten.