Tag: PHP

AFNetworking上传图像

我看了几个例子,但我认为我的问题可能是在PHP中。 我试图从iphone上使用AFNetworking从图像上传到服务器。 这是我的obj-c代码: -(IBAction)uploadButtonClicked:(id)sender { NSData *imageToUpload = UIImageJPEGRepresentation(mainImageView.image, 90); AFHTTPClient *client= [AFHTTPClient clientWithBaseURL:[NSURL URLWithString:@"http://www.THESERVER.com"]]; NSMutableURLRequest *request = [client multipartFormRequestWithMethod:@"POST" path:@"/PROJECT/upload.php" parameters:nil constructingBodyWithBlock: ^(id <AFMultipartFormData>formData) { [formData appendPartWithFileData: imageToUpload name:@"file" fileName:@"temp.jpeg" mimeType:@"image/jpeg"]; }]; AFHTTPRequestOperation *operation = [[AFHTTPRequestOperation alloc] initWithRequest:request]; [operation setCompletionBlockWithSuccess:^(AFHTTPRequestOperation *operation, id responseObject) { NSString *response = [operation responseString]; NSLog(@"response: [%@]",response); [MBProgressHUD hideHUDForView:self.view animated:YES]; […]

警告:stream_socket_client():无法设置私钥文件

无法得到这个得到这些错误时,在PHPterminal运行PHP simplepush.php Warning: stream_socket_client(): Unable to set private key file `/users/accenture/Desktop/newAPNS/ck.pem' in /users/accenture/Desktop/newAPNS/simplepush.php on line 22 Warning: stream_socket_client(): failed to create an SSL handle in /users/accenture/Desktop/newAPNS/simplepush.php on line 22 Warning: stream_socket_client(): Failed to enable crypto in /users/accenture/Desktop/newAPNS/simplepush.php on line 22 Warning: stream_socket_client(): unable to connect to ssl://gateway.sandbox.push.apple.com:2195 (Unknown error) in /users/accenture/Desktop/newAPNS/simplepush.php on line 22 Failed […]

IOS到PHP POST参数?

我试图创build“ 联系我们 ”ViewController,它可以发送电子邮件,但我不想使用MFMailComposeViewController,因为我想设置接收邮件的电子邮件地址。 所以.. 我试图创build一个viewController从用户的所有消息数据,并将其发送到一个PHP页面,将完成剩余的进度,所以我试图发送参数使用GET方法的PHP页面,这是很好的诸如“姓名”或“电话号码”之类的简短参数,但是我无法使用这种方法处理诸如“消息内容”之类的长文本。 所以我决定使用POST方法 ,但是我找不到可以使用POST方法将数据从我的应用程序发送到PHP的 方式 我试图发送三个NSString的名称(MsgTitle,MsgCity,MsgContent) 我的PHP代码 <?php $MsgTitle = $_POST['title']; $MsgCity = $_POST['city']; $MsgContent = $_POST['description']; ?> 我希望有一个简单的方法来做到这一点,并提前感谢你…

如何在iOS Objective-C中实现php的openssl_encrypt()方法?

我想在iOS Objective-C中实现php的openssl_encrypt()方法。 所以我试了这个代码: #import <CommonCrypto/CommonHMAC.h> #import <CommonCrypto/CommonCryptor.h> – (void)viewDidLoad { [super viewDidLoad]; NSData *dataIn = [@"123456" dataUsingEncoding:NSISOLatin1StringEncoding]; NSString *key = @"ygXa6pBJOWSAXXX/J6POVTjvJpMIiPAMQiTMjBrcOGw="; NSData *decodedKeyData = [[NSData alloc] initWithBase64EncodedString:key options:0]; uint8_t randomBytes[16]; NSMutableString *ivStr; int result = SecRandomCopyBytes(kSecRandomDefault, 16, randomBytes); if(result == 0) { ivStr = [[NSMutableString alloc] initWithCapacity:16]; for(NSInteger index = 0; index < 8; index++) […]

APNS Openssl从苹果推送通知从PHP连接?

最后,我已经从我的本地服务器发送通知给我的设备。 我遵循这个教程http://www.raywenderlich.com/3525/apple-push-notification-services-tutorial-part-2 ,许多堆栈溢出的人帮助我达到此目的。 我感谢你们所有的朋友。 我有一个怀疑的服务器设置。 对于我的本地使用,我已经使用MAMP for Apache and MySQL servers 。 最后i open the ssl from Terminal used certificate.pem and key.pem 。 有没有什么办法open ssl from php script 。 但是,我不知道任何单一的PHP脚本,因为我是ios开发人员。 非常遗憾。 昨天我在terminal上用下面的命令打开ssl并连接到APNS, unknownc42c032e8297:~ gopi$ /Applications/MAMP/bin/php/php5.3.6/bin/php /Users/gopi/Desktop/PushChatServer/push/push.php development unknownc42c032e8297:~ gopi$ cd /Users/gopi/Desktop/PushChatServer/push unknownc42c032e8297:push gopi$ telnet gateway.sandbox.push.apple.com 2195 Trying 17.149.34.66… Connected to gateway.sandbox.push-apple.com.akadns.net. Escape character is '^]'. […]

Magento无法login到我的帐户在IOS服务器上

我正在magento网站https://www.smkd.com/index.php上工作。 除了IOS服务器以外,每个浏览器都能正常工作。 当我点击我的帐户或login,并填写我的帐户的详细信息,然后redirect我在同一页面上,不允许我login。 我已经删除了所有的扩展名,但仍然有这个问题,无法login到我的帐户。 我正在使用ultimo主题。 你们能帮我解决这个问题吗?

QuickBlox REST API Laravel上的意外签名

我从QuickBlox REST API获得以下json响应: { "base": ["Unexpected signature"] } 我的签名方法: private function createSignature($login, $password, $timestamp, $nonce) { $signatureContent = "application_id=" . env('QB_APP_ID') . "&auth_key=" . env('QB_APP_KEY') . "&nonce=" . $nonce . "&timestamp=" . $timestamp . "&user[login]=" . $login . "&user[password]=" . $password; return hash_hmac('sha1', $signatureContent, env('QB_APP_SECRET')); } 应用程序ID和授权密钥是正确的。 $signatureContent值(中断线只是为了提高文本的可读性): application_id=24544 &auth_key=6N9bYKT-fKGRQ7q &nonce=268302610 &timestamp=1438287989 &user[login]=tester1@test.net &user[password]=qwer1234 当我尝试创build一个会话时使用这个参数来得到这个响应: […]

正确的标题php mysql blob显示图像

我试图从我的PHP页面中显示一个图像从MySQL blob(我知道它不是最好的做法),然后我将带入我的iOS应用程序。 我无法设置我认为需要设置为图像的页眉。 所以,这显示图像,但我不相信页面标题是正确的: //header("Content-type: image/png"); echo '<img src="data:image/png;base64,' . base64_encode( $row['image1'] ) . '" />'; 但是,这并不显示我的形象: header("Content-type: image/png"); echo '<img src="data:image/png;base64,' . base64_encode( $row['image1'] ) . '" />'; 我错过了什么? 我相信图像应该显示时,标题设置为图像/ PNG,但我得到一个错误,它不能显示,因为错误。 谢谢!

从iOS上传图像到PHP Web服务器

我正在开发一个iOS应用程序,将上传一个图像(从前置摄像头或画廊)到networking服务器。 我不知道如何从iOS发送图像,以及如何在PHP中检索。 请帮助。

使用PHP或Javascript检查iOS版本是否为3.0或更高版本

我需要检查访问我的网站的iOS设备是否安装了iOS 3.0或更高版本。 我可以这样做吗?