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 780645
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T20:06:27+00:00 2026-05-14T20:06:27+00:00

NSString *reqURL = [NSString stringWithFormat:@%@/login,SERVER_URL]; NSMutableURLRequest *req = [[NSMutableURLRequest alloc]initWithURL:[NSURL URLWithString:reqURL]]; [req setValue:@application/x-www-form-urlencoded forHTTPHeaderField:@content-type];

  • 0
    NSString *reqURL = [NSString stringWithFormat:@"%@/login",SERVER_URL];

    NSMutableURLRequest *req = [[NSMutableURLRequest alloc]initWithURL:[NSURL URLWithString:reqURL]];
    [req setValue:@"application/x-www-form-urlencoded" forHTTPHeaderField:@"content-type"];


    NSData *myRequestData = [NSData dataWithBytes:[@"username=whatever&password=whatever" UTF8String] length: [@"username=whatever&password=whatever" length]];
    [req setHTTPMethod: @"POST"];
    [req setHTTPBody: myRequestData];
    NSData *returnData = [NSURLConnection sendSynchronousRequest:req returningResponse: nil error: nil];
    NSString *html = [[NSString alloc] initWithData:returnData encoding:NSUTF8StringEncoding];

I got this code from another question I asked. But what happens if there is more than one submit button. I really have no idea how to ask this question. An example of such situation is on the logout page for this site. There are no fields to enter data into, but there are 2 submit buttons.

How can I “simulate clicking” on one of those buttons using code like the above (so not using a UIWebView)

  • 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-14T20:06:27+00:00Added an answer on May 14, 2026 at 8:06 pm

    The way those forms usually tell which button was pressed is by naming their buttons and checking the value. Simply put, a basic page receiving form data will check if a form was even submitted by checking if ($_POST[‘submit’] == “Send!”) which tells the page that the user got there by pressing the button. The same concept is used when deciding what button was pressed.

    if ($_POST[“submit”] == “Send!”) addDataToDB();
    else if ($_POST[“submit”] == “Update!”) updateUser();
    else if ($_POST[“submit”] == “Remove me!”) removeUser();

    So now, what you need to do is check the source of the html page with the form and find out the name and value of the submit button you want to simulate and add that data to your POST body data in your request

    Update: Oops! misunderstood your question, thought you meant multiple submit buttons in one form on one page, but now i think you meant one form going to another “confirmation” form…In your didRecieveData delegate method you will need to store all the html you get and in your didFinishLoading delegate method you will need to pull out any hidden field names & values and then create a new request with them as your POST data and the url being the “action” url of the form

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

Sidebar

Ask A Question

Stats

  • Questions 519k
  • Answers 519k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer Where did you get this code ? With this parameters… May 16, 2026 at 8:25 pm
  • Editorial Team
    Editorial Team added an answer I ended up changing the bean in the Spring context… May 16, 2026 at 8:25 pm
  • Editorial Team
    Editorial Team added an answer in IE the padding is calculated as part of the… May 16, 2026 at 8:25 pm

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Related Questions

NSString *latitude = [[NSString alloc] initWithFormat:@%g°, coordinate.latitude]; NSString *longitude = [[NSString alloc] initWithFormat:@%g°, coordinate.longitude];
NSString *myfile = [[NSBundle] mainBundle] pathForResource:@fileName ofType:@plist]; NSMutableArray *mydata= [[NSMutableArray alloc] initWithContentsOfFile:myfile]; /* code
NSString *myRequestString = [NSString stringWithFormat:@&nbr=%@&import=%@,tmpString,noSpaces]; NSData *myRequestData = [ NSData dataWithBytes: [ myRequestString UTF8String
NSString *soundURL = [NSString stringWithFormat:@http://translate.google.com/translate_tts?q=%@&tl=%@,strTextOfFilter,strCodeOfLanguage]; NSLog(@URL : %@,soundURL); this show: http://translate.google.com/translate_tts?q=%E4%BD%A0%E5%A5%BD&tl=zh-TW copy url to
NSString *aNSString; CFStringRef aCFString; aCFString = CFStringCreateWithCString(NULL, [aNSString UTF8String], NSUTF8StringEncoding); aCFString = CFXMLCreateStringByUnescapingEntities(NULL, aCFString,
NSString *foo = @ x ; NSRange r = [foo rangeOfCharacterFromSet:[NSCharacterSet whitespaceAndNewlineCharacterSet]]; NSLog(@foo range
NSString *phoneNumber = @2310234432; I would like to create a new string out of
-(NSString *)tableView:(UITableView *)tableView titleForHeaderInSection:(NSInteger)section { } Hi I am very new in objective c.......................through
NSString *temp = [self randomBallPick:temp]; the following error: Pass-by-value argument in message expression is
NSString *tmpTxt = textField.text; BOOL result = [textField becomeFirstResponder]; textField.text = tmpTxt; This works

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.