I am trying to post some login data but the NSStrings lines are not working... Anyone know why?
For example, these lines work
But these don't
Also, it says this isn't allowed 🙁
Thanks,
Emery
For example, these lines work
Code:
NSString *wallPost = @"the super wall post";
NSString *post = [NSString = @username=%@&password=%@,usernameField.text, passwordField.text;
Code:
NSString *hostStr = @THIS IS MY URL/iphonelogin-do.php?;
Code:
#import "LoginTableViewController.h"
@interface LoginTableViewController ()
@property (weak, nonatomic) IBOutlet UITextField *UIEmailTextField;
@property (weak, nonatomic) IBOutlet UITextField *UIPasswordTextField;
@end
@implementation LoginTableViewController
@synthesize UIEmailTextField;
@synthesize UIPasswordTextField;
- (id)initWithStyle:(UITableViewStyle)style
{
self = [super initWithStyle:style];
if (self) {
// Custom initialization
}
return self;
}
- (void)viewDidLoad
{
[super viewDidLoad];
}
- (void)viewDidUnload
{
[self setUIEmailTextField:nil];
[self setUIPasswordTextField:nil];
[super viewDidUnload];
}
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
return (interfaceOrientation == UIInterfaceOrientationPortrait);
}
#pragma mark - barButton Outlet
- (IBAction)loginButtonPressed:(UIBarButtonItem *)sender {
{
NSString *wallPost = @"the super wall post";
NSString *post = [NSString = @username=%@&password=%@,usernameField.text, passwordField.text;
NSString *hostStr = @THIS IS MY URL/iphonelogin-do.php?;
hostStr = [hostStr stringByAppendingString:post];
NSData *dataURL = [NSData dataWithContentsOfURL: [ NSURL URLWithString: hostStr ]];
NSString *serverOutput = [[NSString alloc] initWithData:dataURL encoding: NSASCIIStringEncoding];
if([serverOutput isEqualToString:@Yes]){
UIAlertView *alertsuccess = [[UIAlertView alloc] initWithTitle:@Congrats message:@You are authorized
delegate:self cancelButtonTitle:@OK otherButtonTitles:nil, nil];
[alertsuccess show];
[alertsuccess release];
} else {
UIAlertView *alertsuccess = [[UIAlertView alloc] initWithTitle:@Error message:@Username or Password Incorrect
delegate:self cancelButtonTitle:@OK otherButtonTitles:nil, nil];
[alertsuccess show];
[alertsuccess release];
}
}
}
@end
Also, it says this isn't allowed 🙁
Code:
[alertsuccess release];
Thanks,
Emery