i create a NSURLRequest to post my data in the iphone application to a server to proceed the php script, my php script is look like this
<?php
$name = $_POST['name'];
$email = $_POST['email'];
$link = mysql_connect("localhost", "fffasfdas","Nfdsafafs") or die ("Unable to connect to database.");
mysql_select_db("muradsbi_mydatabase") or die ("Unable to select database.");
$sqlstatement= "INSERT INTO dbname (name,email) VALUES ('$name','$email')";
$newquery = mysql_query($sqlstatement, $link);
echo 'thanks for your register';
?>
and my NSURLRequst is create like below:
NSString *myRequestString = @"&name=Hello%20World&email=Ohai2u";
NSData *myRequestData = [ NSData dataWithBytes: [ myRequestString UTF8String ] length: [ myRequestString length ] ]
NSMutableURLRequest *request = [ [ NSMutableURLRequest alloc ] initWithURL: [ NSURL URLWithString: @"http://www.google.com/" ] ];
[ request setHTTPMethod: @"POST" ];
[ request setHTTPBody: myRequestData ];
NSData *returnData = [ NSURLConnection sendSynchronousRequest: request returningResponse: nil error: nil ];
however, this site is unable to get the data from this application and save it to databse but i know it was connect succussfully because my application is able to get the response data from the server, i dont know whether is my variable name declare in wrongway or others issues can somebody point out for me