好的,为了完成讨论,找不到仅服务器端的解决方案......需要在客户端和服务器端进行修改。
这是我需要传递上传文本的方式(作为 newStr):
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:url cachePolicy:NSURLRequestReloadIgnoringCacheData timeoutInterval:30];
[request setHTTPMethod:@"POST"];
NSString *newStr = (NSString *)CFURLCreateStringByAddingPercentEscapes(
NULL,
(CFStringRef)uploadText.text,
NULL,
(CFStringRef)@"&",
kCFStringEncodingUTF8 );
NSString *parameters = [[NSString alloc] initWithFormat:@"sms=%@&catID=%d&deviceID=%@",newStr,webCatID,[[UIDevice currentDevice] uniqueIdentifier]];
[newStr release];
而服务器端的这个修改:
if ( get_magic_quotes_gpc() )
{
$_POST['sms'] = stripslashes($_POST['sms'] );
}
$query = sprintf("INSERT INTO sms (detail,catID,deviceID) VALUES ('%s', '%d', '%s')",
mysql_real_escape_string($_POST['sms']),
((int) $_POST['catID']),
mysql_real_escape_string($_POST['deviceID']));
特别感谢@PhpMyCoder 和@Shef
&大声笑的紧迫性!