我最近将 php 版本从 4 切换到 5.3。我现在如何一些不再工作的代码。我有一个 PHP 脚本,当用户单击链接时,它会从表单中获取数据到新表单中。
首先它识别用户/帐户,然后找到表单数据。
这是帐户数据的代码:
$account_info = ft_get_account_info($_SESSION["ft"]["account"]["account_id"]);
$emailadresse = ($account_info['email']);
$accountid = ($account_info['account_id']);
$firstname =($account_info['first_name']);
$lastname =($account_info['last_name']);
…………
这行得通,我可以通过例如以下方式显示数据:
<?php echo $_POST['firstname']; ?>
然后我有这个代码来获取和显示表单数据:
$submission_info = ft_get_submission_info($form_id, $submission_id);
$submission_id = ($submission_info['submission_id']);
$partname = ($submission_info['partname']);
$ponumber = ($submission_info['ponumber']);
....
....
<?php echo $_POST['partname']; ?>
这在 PHP 5.3 版中不再起作用。
任何人都可以告诉我需要将这段代码重新编写成什么,以便它工作......????
提前致谢!
除了评论之外,我还有 ft_get_account_info 的代码:
$_SESSION["ft"]["account"] = ft_get_account_info($account_info["account_id"]);
这对于 ft_get_submission_info:
/**
* Returns all information about a submission. N.B. Would have been nice to have made this just a
* wrapper for ft_get_submission_info, but that function contains hooks. Need to revise all core
* code to allow external calls to optionally avoid any hook calls.
*
* @param integer $form_id
* @param integer $submission_id
*/
function ft_api_get_submission($form_id, $submission_id)
{
global $g_table_prefix, $g_api_debug;
// confirm the form is valid
if (!ft_check_form_exists($form_id))
{
if ($g_api_debug)
{
$page_vars = array("message_type" => "error", "error_code" => 405, "error_type" => "user");
ft_display_page("../../global/smarty/messages.tpl", $page_vars);
exit;
}
else
return array(false, 405);
}
if (!is_numeric($submission_id))
{
if ($g_api_debug)
{
$page_vars = array("message_type" => "error", "error_code" => 406, "error_type" => "user");
ft_display_page("../../global/smarty/messages.tpl", $page_vars);
exit;
}
else
return array(false, 406);
}
// get the form submission info
$submission_info = mysql_query("
SELECT *
FROM {$g_table_prefix}form_{$form_id}
WHERE submission_id = $submission_id
");
$submission = mysql_fetch_assoc($submission_info);
return $submission;
}
没有关于错误报告的内容。