PC SOFT

FORUMS PROFESSIONNELS
WINDEVWEBDEV et WINDEV Mobile

Accueil → WEBDEV 2024 → PHPExecute() always empty result
PHPExecute() always empty result
Débuté par Sebastian Arnold, 10 jan. 2011 14:04 - 1 réponse
Posté le 10 janvier 2011 - 14:04
Has anyone tried to use the PHPExecute() function in WebDev?

Whatever I try I always get an empty result.

This is my button click code in WebDev:
sPhpres is string
IF fFileExist("phptest.php")
sPhpres = PHPExecute("phptest.php")
Info("sPhpres: " + sPhpres)
ELSE
Info("File missing!")
END


And these are my unsuccessfull trials with phptest.php:

FUNCTION phptest()
{
$res = 'abc';
RETURN ($res);
}


{
$res = 'abc';
RETURN ($res);
}


{
$res = 'abc';
echo $res;
}


$res = 'abc';
RETURN ($res);


Any help appreciated

TIA
Sebastian
Posté le 12 janvier 2011 - 19:15
I got help from PCSoft Support:

According to Patrick the PHP-Code should look like this:
<?php
echo "Hello PHP !";
?>


I tried this and it worked ok if I call it from localhost:
sMyScript is string = "http://localhost/script.php"
s is string
s = PHPExecute(sMyScript)
Info(s)


But if I change the script source to a path on one of my servers I get this error message
sMyScript is string = "http://mydomain.tld/mypath/script.php"






Strange thing is that although the error message says the script can't be found it runs perfectly when I enter the same link in the browser.

If I simply change the path to
sMyScript is string = "script.php"


I only get an empty result.


Is there anybody out there working with PHP and WebDev?

TIA
Sebastian