Post values to page and hardcode return

error77
error77 used Ask the Experts™
on
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
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Commented:
in pageB, put the PHP open-tag in the very first of file:

<?php
$username = $_POST['username'];
$password = $_POST['password']; 
... Do whatever you want here and put the success result into "$success"
echo $success?"1":"0";
?>

Open in new window

Author

Commented:
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

Commented:
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.

Author

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

Very strange

Author

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

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial