Link to home
Start Free TrialLog in
Avatar of ishani_v
ishani_v

asked on

How to determine if a link is clicked or not staying on the same page in PHP?

Hi,

I have a link on the page, say X, saying "Connect" clicking on which user is redirected to another page, say Y. If everything goes fine on page Y, the user is redirected to page X but instead of link, there is a text saying "Account Connected". But if something goes wrong on page Y, then I need to catch the error and display it on page X and let the link still remain active. How do I do this is in PHP? Since I am not an expert in PHP, I dont know how to do this and I need quick answers as I m stuck with my project.

Thanks in advance
ASKER CERTIFIED SOLUTION
Avatar of Carlos Llanos
Carlos Llanos
Flag of United States of America 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
Wow, sorry, I didn't close the strings properly...

Third code, line 2 needs to be:
 
$buttonText = "Account Connected";

Open in new window


And one more thing...make the Third code: line 1

if ($test == 'OK') {

It needs to have 2 equal signs, not one...

(Still too early in the morning for me...sorry about that)