close ad
Databridge V2 with MySQLi support IS Now Available!
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

redirect successful login to previous page, unless triggered by checkout button

Thread began 7/04/2012 7:30 am by graham | Last modified 7/05/2012 7:42 pm by graham | 3462 views | 11 replies |

graham

redirect successful login to previous page, unless triggered by checkout button

The webassist tutorials have made it relatively simple to produce my website - I am almost always able to find an answer by searching the support forum. For my current issue, redirecting a successful login to the page logged in from (unless triggerred by the checkout button), I have not been able to figure it out myself.

Using eCart and Security Assist tutorials, I have a checkout process that triggers login with the cart page, using the checkout rule - if the checkout button is pushed on the cart page, or from any page's Quick Cart, login triggers and, if successful, passes customer through to the checkout page - perfect. However, I added a login button to each page which permits customers to register/login before they have created cart contents and are ready to proceed to checkout ... how can I redirect this successful login back to the page they were on, instead of the checkout page?

Sign in to reply to this post

Jason ByrnesWebAssist

make the login button a link that passes the current page name as a querystring variable to the login page:

php:
<a href="login.php?accesscheck=<?php echo((isset($_SERVER["PHP_SELF"]))?$_SERVER["PHP_SELF"]:""?>">Log in</a>



the login behavior should use the accesscheck url variable as the redirect location.

Sign in to reply to this post

graham

It worked ... the first time

But, somehow my login page is now no longer recognized on my localhost ... the rest of my site works fine; I can add items to cart, move between pages, etc., but when I hit login, or try to checkout from the cart page, "Internet Explorer cannot display webpage" (?)

I have tried to push the logout.php page, hoping to clear any session issue, but it wouldn't load either. By closing the window, clearing browsing history, etc., I am able to get back in ... however, on the login page, entering a valid user from the database, it fails again.

Thoughts?

Sign in to reply to this post

Jason ByrnesWebAssist

try using Fire Fox for testing, it will probably give you a more intelligible error. also try adding the following code at line 1 to turn error reporting on:

php:
<?php

error_reporting
(E_ALL);
ini_set('display_errors','on');
?>
Sign in to reply to this post

graham

Firefox error message ...

"The page isn't redirecting properly. Firefox has detected that the server is redirecting the request for this address in a way that will never complete. This problem can sometimes be caused by disabling or refusing to accept cookies."

This is what is produced

Sign in to reply to this post

graham

Firefox working - IE not ?

By changing nothing (that I can think of), my entire site seems to be testing well on Firefox, but I am still getting an error on IE.

This is why you get the BIG bucks ... :o)

Anything pop to mind?

Sign in to reply to this post

Jason ByrnesWebAssist

this error means the site is in a n endless loop.

it is redirecting to a page that is causing it to redirect to another page that is causing it to redirect to another page etc.

What page is it redirecting to?

what access rule is on that page?

what is the redirect if that rule fails?

Sign in to reply to this post

graham

Investigating ...

Now made more curious by the fact that it is working on Firefox(?).

Going through your suggestions now.

Sign in to reply to this post

graham

Found a fail condition on Firefox

Not logged in - add items to cart - click login in the cart page header - logs in, but the checkout button goes "the requested URL was not found on this server. The link on the referring page seems to be wrong or outdated."

The checkout button on the cart page, and in the header quick cart, were redirecting to the checkout page up to that point. Unlike in IE, I am able to use my logout button to clear session, which gets the site back to normal - everything works fine until I run that one scenario: add items (not logged in) - login from header on cart page - then use checkout button.

My access to checkout.php is "logged into users"
Page redirect from cart is checkout.php
If access denied to checkout.php "login.php?checkout=1"

Sign in to reply to this post

graham

additional info

If I am not logged in, and go to a products detail page - login from there - it logs me in, but returns me to my blank details.php page (no product info).

Sign in to reply to this post
loading

Build websites with a little help from your friends

Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.

Build websites from already-built web applications

These out-of-the-box solutions provide you proven, tested applications that can be up and running now.  Build a store, a gallery, or a web-based email solution.

Want your website pre-built and hosted?

Close Windowclose

Rate your experience or provide feedback on this page

Account or customer service questions?
Please user our contact form.

Need technical support?
Please visit support to ask a question

Content

rating

Layout

rating

Ease of use

rating

security code refresh image

We do not respond to comments submitted from this page directly, but we do read and analyze any feedback and will use it to help make your experience better in the future.

Close Windowclose

We were unable to retrieve the attached file

Close Windowclose

Attach and remove files

add attachmentAdd attachment
Close Windowclose

Enter the URL you would like to link to in your post

Close Windowclose

This is how you use right click RTF editing

Enable right click RTF editing option allows you to add html markup into your tutorial such as images, bulleted lists, files and more...

-- click to close --

Uploading file...