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
PHP

Avatar of undefined
Last Comment
error77

8/22/2022 - Mon
ASKER CERTIFIED SOLUTION
StingRaY

Log in or sign up to see answer
Become an EE member today7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform
Sign up - Free for 7 days
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
ask a question
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
StingRaY

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.
error77

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

Very strange
All of life is about relationships, and EE has made a viirtual community a real community. It lifts everyone's boat
William Peck
error77

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