03.10.2010, 19:21
(
Последний раз редактировалось i514x; 08.06.2011 в 15:39.
Причина: New Version of Include
)
v2
This little include allows you to run php scripts through pawn
Note: this include requires one .php file which needs to be run through web server
Functions:
• RunPHP(scriptid, code[]);
• FromFile(filename[]);
Callbacks:
• OnScriptResponse(scriptid, contents[])
Example:
php.txt
Some Pawn Script
php.inc
php.php
Upload php.php on your web server, upload php.inc to your pawno/include directory
And to use it at the top of your pawn script add:
also set your security code in php.php 
PS: Sorry for my bad english or if i didn't explain something
This little include allows you to run php scripts through pawn
Note: this include requires one .php file which needs to be run through web server
Functions:
• RunPHP(scriptid, code[]);
• FromFile(filename[]);
Callbacks:
• OnScriptResponse(scriptid, contents[])
Example:
php.txt
Код:
echo('Goodbye World!');
pawn Код:
public OnFilterScriptInit()
{
RunPHP(0, "echo('Hello World!');");
return 1;
}
public OnFilterScriptExit()
{
RunPHP(1, FromFile('php.txt'));
return 1;
}
public OnScriptResponse(scriptid, contents[])
{
if(scriptid == 0) printf("OnFilterScriptInit: %s", contents);
if(scriptid == 1) printf("OnFilterScriptExit: %s", contents);
return 1;
}
php.php
Upload php.php on your web server, upload php.inc to your pawno/include directory
And to use it at the top of your pawn script add:
pawn Код:
#define PHP_FILE_LOCATION "CHANGEME" //the web addreess to php.php file
#define SECURITY_CODE "YOUR_SECURITY_CODE" //here goes your security code
#include <php>

PS: Sorry for my bad english or if i didn't explain something
