我谷歌了相当多,但我找不到一个例子或教程,所以你们能帮我想一个代码,可以登录到smf论坛?
我的猜测是我应该使用ASIIHTTPRequest?
发布于 2011-10-14 01:39:29
__block ASIFormDataRequest *request;
//login to SMF - this works
request = [ASIFormDataRequest requestWithURL: [NSURL URLWithString: @"https://imtgapp.com/forum/index.php?action=login2"]];
[request setPostValue: @"test" forKey: @"user"];
[request setPostValue: @"12345" forKey: @"passwrd"];
[request setPostValue: @"1" forKey: @"cookieneverexp"];
[request setPostValue: @"" forKey: @"hash_passwrd"]; //TODO ?
[request setValidatesSecureCertificate: NO];
[request setCompletionBlock: ^{
//TODO verify if login was successful
NSLog( @"%@", [request responseString] );
}];
[request setFailedBlock: ^{
NSLog( @"Unresolved error %@, %@", [request error], [[request error] userInfo] );
}];
[request startAsynchronous];发布于 2012-11-09 06:43:33
您可以使用SSI特性:http://simplemachines.org/community/ssi_examples.php
<?php
require("SSI.php");
// Shows a login box only when user is not logged in
ssi_login();
?> ..。
https://stackoverflow.com/questions/7282839
复制相似问题