Link to home
Start Free TrialLog in
Avatar of error77
error77

asked on

Post values to page and hardcode return

Hi all,

I have 2 pages PageA and pageB. PageA posts some values to pageB and pageB gets it.

Now, my problem is that the code is expecting a 0 or 1 as return...

Here is the code for pageA:

- (void)SubmitLogin
{    
    NSURL *url = [NSURL URLWithString:[(BakerClaimsAppDelegate*)[[UIApplication sharedApplication] delegate] GetLoginURL]];

    ASIFormDataRequest *request = [ASIFormDataRequest requestWithURL:url];
    [request setPostValue:[userName text] forKey:@"username"];
    [request setPostValue:[password text] forKey:@"password"];
    [request setUploadProgressDelegate:self];
    [request setDelegate:self];
    [request startAsynchronous];
}

Open in new window


and PageB has:

$username = $_POST['username'];
$password = $_POST['password']; 

Open in new window


My question  is...how do I provide this return in from pageB to pageA in PHP?

I basically need pageA to think it's all ok by returning a 1 even if it's hardcoded.

Thanks
ASKER CERTIFIED SOLUTION
Avatar of StingRaY
StingRaY
Flag of Thailand image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of error77
error77

ASKER

Tried that but for some reason I'm getting login error which means it still thinks that success = 0

This is what i've done:

<?php
$username = $_POST['username'];
$password = $_POST['password']; 
$success = 1;
echo $success?"1":"0";
?>

Open in new window


Is this wrong?

Thanks
What is displayed if you call the code directly from your browser? Just "1"?
Make sure there is no any other text returned with 1, including with whitespaces.
Avatar of error77

ASKER

Yes, it's just echoing 1 no extras or spaces.

Very strange
Avatar of error77

ASKER

But I guess you've actually already answered the question so thanks!