下面提到的代码在5.3.17上工作正常,我有php 5.3.27,问题是我必须让这段代码在5.3.27上运行
链接到完整代码:http://www.videobluemoon.com/secure/add.txt
$customer_id = (int)$_REQUEST['customer_id'];
if($customer_id => 0 ) {
$query = $query.','.$_REQUEST['customer_id'];
} else {
die('cust id: '. $_REQUEST['customer_id']);
die('Please use your browser\'s back button to ensure you have selected a customer');
}
if($customer_id => 0 ) {
$query = $query.', '.$_REQUEST['sysuser_id'];
else
die ('There was a problem with the system user');
答案 0 :(得分:6)
答案 1 :(得分:1)
使用 ==
代替 =>
=>
用于访问数组的键值对,而 ==
用于比较操作。
<?php
$customer_id = (int)$_REQUEST['customer_id'];
if ( $customer_id == 0 ){
$query = $query . ',' . $_REQUEST['customer_id'] . "";
}else{
die( 'cust id: ' . $_REQUEST['customer_id']);
die ( 'Please use your browser\'s back button to ensure you have selected a customer' );
}
if ( $customer_id > 0 ){
$query = $query . ', ' . $_REQUEST['sysuser_id'] . "";
}
else
{
die ( 'There was a problem with the system user' );
}
答案 2 :(得分:0)
=>
它应该是>=
,但您的代码看起来像
$customer_id = (int)$_REQUEST['customer_id'];
if ( $customer_id == 0 ){
$query = $query . ',' . $_REQUEST['customer_id'] . "";
}else{
die( 'cust id: ' . $_REQUEST['customer_id']);
die ( 'Please use your browser\'s back button to ensure you have selected a customer' );
}
if ( $customer_id > 0 ){
$query = $query . ', ' . $_REQUEST['sysuser_id'] . "";
} else {
die ( 'There was a problem with the system user' );
}