2017-12-27 203 views
0

我想通过插入外部PHP脚本的一些纪录phpfox框架表的用户phpfox_user

应用reference .The登记表phpfox_user访问phpfox之外的php库函数以前工作正常。

$iId = Phpfox::getService('user.process')->add($aVals);

// if fine, $iId is ID of user in `phpfox_user` table, otherwise $iId = false. 


<?php 
echo "This is the beginning."; 
include('auth.php'); 
include('config1.php'); 
define('PHPFOX', true); 
define('PHPFOX_DS', DIRECTORY_SEPARATOR); 
define('PHPFOX_DIR', dirname(__FILE__) . PHPFOX_DS); 
define('PHPFOX_START_TIME', array_sum(explode(' ', microtime()))); 
require_once(PHPFOX_DIR . 'include' . PHPFOX_DS . 'init.inc.php'); 


    $aVals = array(
'full_name' => 'Naveen Kumart', 
'email' => '[email protected]', 
'password' => 'Alobha1', 
'gender' => 1, // 1: male 2: female 
); 

if (Phpfox::getParam('core.registration_enable_dob')) { 
// if birthday on registration is required, assign birthday parameters here. I give a sample 1/1/1988 
$aVals['month'] = '1'; 
$aVals['day'] = '1'; 
$aVals['year'] = '1988'; 


} 

$iId = Phpfox::getService('user.process')->add($aVals); 

// if fine, $iId is ID of user in `phpfox_user` table, otherwise $iId = false. 
if ($iId) { 
echo $iId; 
} else { 
echo 'false'; 
} 

echo "This is the end"; 


?> 
+1

有什么问题有警告或错误? –

回答

0

如果使用phpFox V4,更换:

<?php 
echo "This is the beginning."; 
include('auth.php'); 
include('config1.php'); 
define('PHPFOX', true); 
define('PHPFOX_DS', DIRECTORY_SEPARATOR); 
define('PHPFOX_DIR', dirname(__FILE__) . PHPFOX_DS); 
define('PHPFOX_START_TIME', array_sum(explode(' ', microtime()))); 
require_once(PHPFOX_DIR . 'include' . PHPFOX_DS . 'init.inc.php'); 

通过

define('PHPFOX_PARENT_DIR', __DIR__ . DIRECTORY_SEPARATOR); 
define('PHPFOX_NO_RUN', true); 
require('./PF.Base/start.php'); 

更新PHPFOX_PARENT_DIR如果你的文件与指数相同的目录。 php

+0

感谢信息,我使用的版本 - 核心版本:3.7.6beta1(建设1) PHP版本: 5.6.32-1 + ubuntu16.04.1 + deb.sury.org + 1 – user8231297

+0

我现在用的PHPFox版本 - 3.7.6 – user8231297

相关问题