Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8480973
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T19:26:23+00:00 2026-06-10T19:26:23+00:00

i can’t send my values to my php file. My app pauses, because there

  • 0

i can’t send my values to my php file.
My app pauses, because there is a thread at the send connect

- (void)connection:(NSURLConnection *)connection didReceiveResponse:(NSURLResponse *)response {
    responseData = [[NSMutableData alloc] init];
}





         NSURL *url = [NSURL URLWithString:@"http://www.yoursite.nl/locatie.php"];

    NSMutableURLRequest *theRequest = [NSMutableURLRequest requestWithURL:url
                                                              cachePolicy:NSURLRequestReloadIgnoringCacheData
                                                          timeoutInterval:60];

    [theRequest setHTTPMethod:@"POST"];
    [theRequest setValue:@"application/x-www-form-urlencoded" forHTTPHeaderField:@"Content-Type"];

    NSString *postData = [NSString stringWithFormat:@"longitude=%@&latitude=%@&stringFromDate=%@", longitude, latitude, stringFromDate];

    NSString *length = [NSString stringWithFormat:@"%d", [postData length]];
    [theRequest setValue:length forHTTPHeaderField:@"Content-Length"];

    [theRequest setHTTPBody:[postData dataUsingEncoding:NSASCIIStringEncoding]];




    - (void)connection:(NSURLConnection *)connection didReceiveResponse:(NSURLResponse *)response {
        responseData = [[NSMutableData alloc] init];
    }

    - (void)connection:(NSURLConnection *)connection didReceiveData:(NSData *)data {
        [responseData appendData:data];
    }

    - (void)connection:(NSURLConnection *)connection didFailWithError:(NSError *)error {
        [responseData release];
        [connection release];
        [textView setString:@"Unable to fetch data"];
    }

    - (void)connectionDidFinishLoading:(NSURLConnection *)connection
    {
        NSLog(@"Succeeded! Received %d bytes of data",[responseData
                                                       length]);
        NSString *txt = [[[NSString alloc] initWithData:responseData encoding: NSASCIIStringEncoding] autorelease];

    }

    }

My PHP file looks like this:

<?php

 $id = $_POST['id'];
 $longitude = $_POST['longitude'];
  $latitude = $_POST['latitude'];
  $timestamp = $_POST['stringFromDate'];

  $con = mysql_connect('db.server.nl', 'user', 'pass');
  if (!$con)
  {
 die('Could not connect: ' . mysql_error());
 }

  mysql_select_db("db", $con);

  mysql_query("INSERT INTO locatie (id, longitude, latitude, timestamp)
   VALUES ('06', 'longitude','latitude','timestamp')");

 mysql_close($con);
  ?>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-10T19:26:25+00:00Added an answer on June 10, 2026 at 7:26 pm

    You can add the following code….

    NSString *post = [[NSString alloc] initWithFormat:@"log=%@&pwd=%@",strUserName,strPassword];
    NSData *postData = [post dataUsingEncoding:NSASCIIStringEncoding allowLossyConversion:YES];
    NSString *postLength = [NSString stringWithFormat:@"",[postData length]];
    NSURL *url = [NSURL URLWithString:@"http://ideaact.neonexusdemo.com/wp-content/themes/idea/andr.php"];
    NSMutableURLRequest *theRequest = [NSMutableURLRequest requestWithURL:url];
    [theRequest setHTTPMethod:@"POST"];
    [theRequest setValue:postLength forHTTPHeaderField:@"Content-Length"];
    [theRequest setHTTPBody:postData];
    NSURLConnection *theConnection = [[NSURLConnection alloc] initWithRequest:theRequest delegate:self];
    if (theConnection) {
        webData = [[NSMutableData data] retain];
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Can PHP PDO extension bind nested objects automatically ? I mean using foreign key
Can someone help me with this scenario? *There is a button, which when tapped,
Can someone tell me how does the imdb app manage to play trailers on
Can anyone tell me why this doesn't work? <?php $lang = $_get[lang]; if (($lang
Can a LINQ enabled app run on a machine that only has the .NET
Can any one help me in sorting this out in sed/awk/perl Input file Start
Can i call a Method on the Thread Object ??
Can someone access the database files and/or other files of my app stores in
Can I know if there is anyway that I can maximise my windows form
Can anyone let me know how can we change the value of kendo combobox

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.