The UK Home Automation Archive

Archive Home
Group Home
Search Archive


Advanced Search

The UKHA-ARCHIVE IS CEASING OPERATIONS 31 DEC 2024


[Message Prev][Message Next][Thread Prev][Thread Next][Message Index][Thread Index]

Re: xAP and PHP



On Sat, 2005-12-17 at 01:10 +0000, Andrew Jones wrote:
> Hi everyone. Is it possible to run xAP Send from a PHP page? At the
> moment I have the following code:
>
> <?php
> system("C:\Program Files\xAPFramework.net\xAP Send\Send.exe
on.xap")
> ?>
>
> ...which does nothing. I've put '> null' at the end but it doesn't
> help. I don't know PHP so it's probably completely wrong :)
>
> Any ideas? By the way, I'm using IIS 4, and phpinfo() shows the
> information it should, so PHP looks like it's ok.

I use Apache2 and Perl, and the code I have is in a routine called
xap.cgi which takes the name of a pre-canned xap file as the argument:

------------------------------------------

print "Cotent-type: text/plan\n\n";
print "<HEAD>";
$xapcall="xap-send.exe ".$ENV("QUERY_STRING")
print "<META-EQUIV=\"Refresh\"
Content=\"0;URL=\\lounge.html/">";
system $xapcall > null;
print "\n<\HEAD>";

------------------------------------------


Apart from the obvious "different context" issues, there is the
difference that I ended up putting xap-send in the path rather than
trying to reference it by location.


In debugging, ISTR that I had to work out whether it was a PERL issue or
a xAP issue, and that the way I did that was putting replacing
"xap-send.exe" with a call to "notepad.exe" and watch
for whether
notepad appeared on the server console :-)

Mark




xAP_Automation Main Index | xAP_Automation Thread Index | xAP_Automation Home | Archives Home

Comments to the Webmaster are always welcomed, please use this contact form . Note that as this site is a mailing list archive, the Webmaster has no control over the contents of the messages. Comments about message content should be directed to the relevant mailing list.