Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to use Prolog and PHP

Status
Not open for further replies.

renata12345

Instructor
Sep 28, 2010
8
GR
Hi there! I'd like to pose a question.
I'm building a site using PHP and I want to add an expert system i created using SWI-Prolog. The only problem is that i don't know how to do that...
The expert syestem helps users choose a lesson providing them 2-3 choices based on their answers.
What i want is when the user enters a certain page he 'll be able to start using the expert system and answer the system's questions.
Is there a way i can achieve that?

I'd appreciate any help!

Renata
 
Yeah.. although it's a nice idea that's not exactly what I want. What I need is to create a site using PHP and the expert system embedded itno the PHP page...
Is there a way i can do that?

Renata
 
Hi there!

I looked at the link you suggested and although it looks fine i have a problem while runnnig it... I have no output at all!!
this is how i modified the code:
<?php $cmd = "nice -n15 plwin.exe -L128k -G128k -T128k -A128k -f test.pl -g test,halt"; //definition of cmd variable.
echo $cmd; //echo works fine.
?>
<P>
<PRE>
<?php
$output = exec( $cmd );
echo $output; //thethere's no output (it shows blank)> echo "\n";
exec( $cmd, $output, $retval ); //executing the exec function.
print_r( $output ); //it prints out Array ()
echo $output ; //it prints out Array>
echo "\n";> echo $retval; //the value returned is 1, which means there's an> error...
?>

I even try using the command prompt to call the desired file using
C:\route\to\the\file\test.pl and although it calls Prolog succesfully I don't know how to cosnult the file i want from the command line.

To sum up, is there something Ican do so I can call Prolog and my pl file successfully from PHP?

Thanks in advance

Renata.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top