Call a PHP script from a livecode server script
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
Call a PHP script from a livecode server script
I am having what seems to be a simple problem to solve, but I can't.
How do I post data to an existing php script? I receive it fine with this
<?lc
put $_POST["FName"] into firstname
put "FName=" & firstname into PostToPHPScript
post PostToPHPScript to URL("http://domain.com/receivepost.php")
?>
My php script reads:
<?php
$fname=($_POST["FName"]);
echo $fname;
?>
and the page errors with:
"Internal Server Error
The server encountered an internal error or misconfiguration and was unable to complete your request.
Please contact the server administrator, webmaster@johnkane.on-rev.com and inform them of the time the error occurred, and anything you might have done that may have caused the error.
More information about this error may be available in the server error log.
Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request."
Obviously, I am using on-rev.com as my host.
The php script works fine when called as the form action. And the LiveCode script does as well. It is only when I do a livecode server html post to a php script that it fails.
Any help would be appreciated.
Thanks,
John
How do I post data to an existing php script? I receive it fine with this
<?lc
put $_POST["FName"] into firstname
put "FName=" & firstname into PostToPHPScript
post PostToPHPScript to URL("http://domain.com/receivepost.php")
?>
My php script reads:
<?php
$fname=($_POST["FName"]);
echo $fname;
?>
and the page errors with:
"Internal Server Error
The server encountered an internal error or misconfiguration and was unable to complete your request.
Please contact the server administrator, webmaster@johnkane.on-rev.com and inform them of the time the error occurred, and anything you might have done that may have caused the error.
More information about this error may be available in the server error log.
Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request."
Obviously, I am using on-rev.com as my host.
The php script works fine when called as the form action. And the LiveCode script does as well. It is only when I do a livecode server html post to a php script that it fails.
Any help would be appreciated.
Thanks,
John
Re: Call a PHP script from a livecode server script
Hi John
Looks like that should work - maybe best to talk to on-rev tech support.
This works fine on my server:
LC Script:
<?lc
put "test" into firstname
put "FName=" & firstname into PostToPHPScript
post PostToPHPScript to URL("path-to-php-script")
put it
?>
PHP Script:
<?php
$fname = $_POST["FName"];
echo $fname;
?>
Maybe just check that the filenames are correct, and see if the log file shows anything.
Kind Regards
Simon
Looks like that should work - maybe best to talk to on-rev tech support.
This works fine on my server:
LC Script:
<?lc
put "test" into firstname
put "FName=" & firstname into PostToPHPScript
post PostToPHPScript to URL("path-to-php-script")
put it
?>
PHP Script:
<?php
$fname = $_POST["FName"];
echo $fname;
?>
Maybe just check that the filenames are correct, and see if the log file shows anything.
Kind Regards
Simon
Re: Call a PHP script from a livecode server script
Thanks,
I thought it should work too, but it doesn't.
I will reach out to the folks at on-rev.
John
I thought it should work too, but it doesn't.
I will reach out to the folks at on-rev.
John
-
- VIP Livecode Opensource Backer
- Posts: 9833
- Joined: Sat Apr 08, 2006 7:05 am
- Location: Los Angeles
- Contact:
Re: Call a PHP script from a livecode server script
Are you able to use "get url..." to obtain data from any other host within your LC Server script?
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn
Re: Call a PHP script from a livecode server script
Hi Richard,
I haven't tried a http get, if that is what you mean.
John
I haven't tried a http get, if that is what you mean.
John
Re: Call a PHP script from a livecode server script
Are the permissions of your LiveCode script correctly set for execution?
Re: Call a PHP script from a livecode server script
Good question. What should they be? 755?
-
- VIP Livecode Opensource Backer
- Posts: 9833
- Joined: Sat Apr 08, 2006 7:05 am
- Location: Los Angeles
- Contact:
Re: Call a PHP script from a livecode server script
Yes, the 7 gives you as the file's owner the permission to do anything you like with it, while the two 5s grant execution permission to the ownership group and everyone else but without write permission.
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn