Results 1 to 3 of 3

Thread: Redirecting after logging in

  1. #1
    Thread Starter
    Rookie sunnyt7's Avatar
    Join Date
    Jul 2011
    Location
    Canada
    Posts
    8
    Thanks
    0
    Thanked 5 Times in 2 Posts

    Question Redirecting after logging in

    Hey guys,

    I need some help here. I've looked around the forums and got some good background knowledge, but I can't find out how to do this with the latest version of Classipress (3.2.1) specifically.

    Basically, if I'm on an ad page, and I click to log-in, I'd like it to redirect to that ad page once I've logged in.
    I have a general idea of how I can make that happen (using $_SERVER[HTTP_REFERER]), but I can't find WHERE to make it happen. I tried modifying includes/theme-actions.php, but that doesn't seem to have an effect.

    The other thing I tried, which is similar to the registration page, is adding
    Code:
    <input type="hidden" name="redirect_to" value="<?php echo esc_attr($redirect); ?>" />
    to the form, and
    Code:
    if (!isset($redirect)) $redirect = $_SERVER[HTTP_REFERER];
    in the php at the top.

    This actually works, but it interferes with some of the predefined redirects. For example, when logged out and clicking "Post an Ad," you normally log-in, and it redirects you to step 1 of the create an ad form. With my modification though, it now takes me back to the homepage, which is undesirable. I'm sure there are other instances as well.

    So does anyone know how I can change the function for the login redirect, to go from the homepage to the current/previous page?

  2. #2
    Thread Starter
    Rookie sunnyt7's Avatar
    Join Date
    Jul 2011
    Location
    Canada
    Posts
    8
    Thanks
    0
    Thanked 5 Times in 2 Posts
    You must be an AppThemes customer and logged in to view this response. Join today!

  3. The Following 2 Users Say Thank You to sunnyt7 For This Useful Post:

    mayed (February 23rd, 2013), paulogoode (January 6th, 2013)

  4. #3
    Moderator ovidiubica's Avatar
    Join Date
    Mar 2011
    Posts
    5,749
    Thanks
    240
    Thanked 1,060 Times in 999 Posts
    You must be an AppThemes customer and logged in to view this response. Join today!

  5. The Following User Says Thank You to ovidiubica For This Useful Post:

    mayed (September 11th, 2013)

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. redirecting the coupon title
    By jujukoja in forum Clipper General Discussion
    Replies: 8
    Last Post: September 15th, 2016, 12:19 AM
  2. [SOLVED] Login no redirecting properly
    By korrigan in forum Report Vantage Bugs (Legacy)
    Replies: 5
    Last Post: December 2nd, 2012, 04:05 PM
  3. v1.1.1 - Coupon Code redirecting to 404
    By hyemynameis in forum Report Clipper Bugs
    Replies: 10
    Last Post: November 16th, 2011, 05:28 PM
  4. No redirecting to Paypal
    By tordehax in forum Report ClassiPress Bugs
    Replies: 12
    Last Post: December 8th, 2010, 12:30 PM