CÓïÑÔÓëPHPͨÐŵÄÎÊÌâ(SOCKET) - VC/MFC / ÍøÂç±à³Ì
ÎÒÓÐÒ»¸öÎÊÌ⣬¾ÍÊÇCÓïÑÔºÍPHPͨÐŵÄÎÊÌâ¡£
±ÈÈç PHPÍøÒ³×÷Ϊ·þÎñ¶Ë CÓïÑÔ±àдµÄ³ÌÐò×÷Ϊ¿Í»§¶Ë
ÔÚ½¨Á¢Á¬½ÓµÄʱºòÐèÒª²»ÐèÒª·þÎñÆ÷ÄDZ߿ª·ÅÌض¨µÄ¶Ë¿Ú£¿
ÁíÍâÓÐÒ»¸öСÇëÇó£¬ÄÄλÓÐPHPºÍC/C++±àдµÄ½¨Á¢SOCKETÁ¬½ÓµÄ´úÂë¸ø¶Î¿´¿´(PHPΪ·þÎñ¶Ë£¬C/C++/SDK±àдµÄ³ÌÐòΪ¿Í»§¶Ë)
MFCµÄ¿´²»¶®ÁË¡£
PHPÊDZȽÏÁ÷ÐеĽű¾ÓïÑÔ£¬WEB¿ª·¢Ê¹Óù㷺£¬ÈçºÎÔÚC++³ÌÐòÖв»ÒÀÀµÈκÎWEB SERVERµ÷ÓÃPHP£¬²¢È¡µÃÖ´Ðнá¹ûÍê³É½»»¥£¬ÕâÊDZ¾ÎÄ´úÂëËùҪʵÏֵŦÄÜ¡£
PHP°²×°ºÃºó£¬ÔÚĿ¼ÏÂÓÐÒ»¸öphp-cgi.exe£¬ÎÒÃÇÖ»ÒªÖ´ÐÐÕâ¸öCGI³ÌÐò£¬²¢½«Êý¾Ýͨ¹ýÃüÃû¹ÜµÀ´«µÝ¸øËü£¬È»ºó°ÑÖ´Ðнá¹ûͨ¹ýÃüÃû¹ÜµÀ¶ÁÈ¡³öÀ´¼´¿É£¬¹ý³Ì²¢²»¸´ÔÓ£¡Çë¿´ÈçÏ´úÂ룺
ÃüÃû¹ÜµÀµÄ´´½¨£º
SECURITY_ATTRIBUTES sa = {sizeof(SECURITY_ATTRIBUTES)};
sa.bInheritHandle = 1;
sa.lpSecurityDescriptor = NULL;
HANDLE hStdoutR, hStdoutW, hStdinR, hStdinW;
CreatePipe(&hStdoutR, &hStdoutW, &sa, 0);
SetHandleInformation(hStdoutR,HANDLE_FLAG_INHERIT, 0);
CreatePipe(&hStdinR, &hStdinW, &sa, 0);
SetHandleInformation(hStdinW, HANDLE_FLAG_INHERIT, 0);
Æô¶¯php-cgi½ø³Ì: STARTUPINFO si = {sizeof(STARTUPINFO)};
PROCESS_INFORMATION pi;
si.dwFlags = STARTF_USESTDHANDLES;
si.hStdOutput = hStdoutW;
si.hStdInput = hStdinR;
char env[255] = "REQUEST_METHOD=POST\0CONTENT_LENGTH=18\0CONTENT_TYPE=
application/x-www-form-urlencoded\0SCRIPT_FILENAME=D:\\test.php";
if(!CreateProcess(NULL, "d:\\php5\\php-cgi.ex
Ïà¹ØÎÊ´ð£º
ÇëÎÊVFPÖÐÈçºÎµ÷ÓÃC/C++º¯Êý£¿
ÄãÒªµ÷ÓÃʲô¹¦Äܵĺ¯Êý£¿Òª¿´¿´VFPÖÐÓÐûÓжÔÓ¦µÄº¯Êý£¬Èç¹ûÓоÍÊ¡×ÅÔÙµ÷ÓÃÁË¡£Èç¹ûûÓУ¬¿ÉÒÔ½«C/C++º¯Êýд¸öDLL»òFLL£¬È»ºóÔÚVFPµ÷Óü´¿É¡£
Ê®¶¹Èý ÀÏʦ£¬Ôõô²ÅÄÜÐÞ¸Ä×Ô¼ºµÄ ......
Ä¿Ç°ÔÚÎ人ÕÒ¹¤×÷
·¢Ïִ󲿷ֹ«Ë¾ÎÞÍâºõÁ½ÖÖ
Ò»ÖÖÊǸãÍâ°üµÄ ÒªÓÃzend,cakephpµÈÍâ¹ú¿ò¼Ü
»¹ÒªÊìϤÍâ¹ú¿ªÔ´ÏµÍ³
Ò»ÖÖ¹úÄÚµÄ ÎÞÍâºõ dedecms ecshop shopexÕ⼸ÖÖ¸ÄÕ¾µã ÓеĹ«Ë¾ÉõÖÁÄÃһЩ¸üСµÄϵͳ¸ ......
ÈçÌ⣬Ôõôд¸öheadÍ·²¿ ÈÃÒ³Ã滺´æ1ÐÇÆÚ¡£
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
Äã°ÑÀïÃæµÄʱ¼ä£¬¸Ä³Éµ±Ç°Ê±¼ä¼ÓÉÏÒ»¸öÐÇÆÚ
¼ÇµÃҪת»»³Égmtʱ¼ä
ÎÒÕâÑùдµÄ ²»ÖªµÀÐв»ÐС£
Ò»¸öÐ ......
ÎÒ×î½üдÁ˸ömailÖ´ÐкóûÓгöÏÖ´íÎóÐÅÏ¢Ö´ÐÐÍê±ÏºóÓÊÏäÀﲢû·¢ËÍÓʼþ£¬Çë¸÷λ°ïÎÒ¿´¿´
ÎÒÓõĵÄÊÇiis smtp
<?php
$to = 'xueyuxia1988@sohu.com';
$subject = 'the subject';
$message = 'hello';
$ ......
Çë½Ì¸ßÊÖ°ï棬session_start£¨£©·ÅÔÚÍⲿµÄÎļþÓà require »ò include °üº¬½øÀ´£¬ÇëÎÊÕâÑù×öºÏÀíÂ𣿣¿´úÂëÔËÐÐÊÇÕý³£µÄ£¬ÕâÑù×öºÏÀíÂ𣿣¿Çë¸ßÊÖÖ¸µã¡£¡£¡£¡£ лл····
require »ò include ......