ASIHTTPRequest 라이브러리를 사용해야한다고 생각합니다. POST를 사용하여 매우 간단한 쿼리를 실행할 수 있습니다. ios도 사용할 수 있지만 ASIHTTPRequest가 훨씬 쉽게 발견되었습니다.
지금, 당신은 서버에서 STH 같은 (아주 기본적인 물건을) PHP 스크립트가 필요합니다
store.php :
<?
$email = $_POST['email'];
// for now we send email to confir script work
mail($email, 'GREAT!', "YOU SIGNED FOR OUR NEWSLETTER, WE WILL SPAM YOU");
printf("OK"); // output we can read via ASIHTTP
// here should be be code for storing $email var in database/text file
?>
그래서
지금 당신은 몇 가지 추가 POST와 http://www.myserver.com/store.php 을 요청해야 인수는 다음과 같습니다.
NSURL *url = [NSURL URLWithString:@"http://www.myserver.com/store.php"];
ASIFormDataRequest *request = [ASIFormDataRequest requestWithURL:url];
// email is variable name, we read it in php script
[request setPostValue:@"[email protected]" forKey:@"email"];
[request startSynchronous]; // you should use async here
최근에 비슷한 해결책을 테스트했지만 작동합니다. 해피 코딩
나는이 솔루션을 좋아한다. 구현하고 관리하는 것이 더 쉬울 수도있다. –