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

  • Home
  • SEARCH
  • 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 6627883
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T22:03:57+00:00 2026-05-25T22:03:57+00:00

I have a code that sends POST data to a PHP website. Code: request

  • 0

I have a code that sends POST data to a PHP website. Code:

request = [ASIFormDataRequest requestWithURL:[NSURL URLWithString:@"http://www.example.com/Testing/Testing.php"]];
    [request setPostValue:targettype forKey:@"targettype"];
    [request setPostValue:targetmethod forKey:@"targetmethod"];
    [request setPostValue:sourceurl forKey:@"sourceurl"];
    [request setPostValue:filepath forKey:@"filepath"];

    [request setDelegate:self];
    [request startAsynchronous];

This is working perfectly. Once this data is sent and the PHP script outputs some data, the script creates a .txt file. Once the iPhone reads the contents of the .txt file, I want to run ASIHTTPRequest to a different PHP script that is supposed to delete this .txt file. From a PHP end, everything seems to be working, and the data is being received perfectly by the iPhone. However, once the data is received, I have a if…then statement that checks for the data and then once the data is present, I want to call ASIHTTPRequest to delete the .txt. This is the code I used to POST the data to the new PHP location:

{...
    imageView.image = [UIImage imageWithData:[NSData dataWithContentsOfURL:[NSURL URLWithString: string]]];
            [self deletefile];
   }

-(void) deletefile {
        request = [ASIFormDataRequest requestWithURL:[NSURL URLWithString:@"http://www.prajoth.com/Testing/Testing.php"]];
        [request setPostValue:@"hey" forKey:@"targettype"];
        [request setPostValue:@"hey" forKey:@"targetmethod"];
        [request setPostValue:@"hey" forKey:@"sourceurl"];
        [request setPostValue:filepath forKey:@"filepath"];

        [request setDelegate:self];
        [request startAsynchronous];


    }

This is for some reason, throwing up a EXC_BAD_ACCESS. The console does not show any error message though. Please help!

  • 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-05-25T22:03:58+00:00Added an answer on May 25, 2026 at 10:03 pm

    Based on the code you’ve pasted, it’s going to be difficult to figure this out. Where exactly is your app throwing the exception? It could be perhaps one of your global variables doesn’t exist any more (filepath, for example), but then again it could also be something elsewhere in your code. EXC_BAD_ACCESS messages, as you can probably guess, occur when you try to access an object that’s no longer in memory, so maybe you are releasing something earlier on which you now rely on?

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have the following code that works on PHP5 to send a HTTP POST
I have the following line of PHP code which works great: exec( 'wget http://www.mydomain.com/u1.php
I have code that sends emails to users from a signup webpage. Occasionally, users
I have code that looks like: //System.Data.IDataRecord dr try { Consolidated = Utility.NullConvert.ToBool(dr[Constants.Data.Columns.cConsolidated], false);
I have a page where the user sends data (via ajax) to a php
I have a web page that thats sends an Ajax request with a javascript
I have this code that sends a text message to your mobile phone... $text
I modified the code here (http://www.w3schools.com/PHP/php_ajax_database.asp) to update and display my database after an
After user registration, website send activation code to email. something like that. www.domain.com/?activate=<code> I'm
I have this code that takes info from a form and sends it to

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.