vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   Redirect to the previous page (https://vborg.vbsupport.ru/showthread.php?t=309375)

A.Chakery 03-10-2014 08:13 PM

Redirect to the previous page
 
Hello,

I created a custom login page for my forum but I have a problem with redirecting the logged in members to the previous page which they have been viewing as guest!

is there any way to do this ?

Thank you.

ozzy47 03-11-2014 08:59 PM

What is the code you used for the custom login page?

A.Chakery 03-14-2014 09:21 PM

Quote:

Originally Posted by ozzy47 (Post 2486543)
What is the code you used for the custom login page?

Thank you for your reply,

This is a part of code which is related to login section :

HTML Code:

<td class="alt1">
<div align="center"><strong style="font-size:16px;">Sign-in</strong></div>
                            <script type="text/javascript" src="clientscript/vbulletin_md5.js?v=$vboptions[simpleversion]"></script>
                            <form action="login.php?do=login" method="post" onsubmit="md5hash(vb_login_password, vb_login_md5password, vb_login_md5password_utf, $show[nopasswordempty])">
                               
                                <blockquote><p>$errormessage</p></blockquote>

                                    <table cellpadding="0" cellspacing="$stylevar[formspacer]" border="0" align="center">
                                        <tr>
                                            <td>$vbphrase[username]:<br /><input type="text" class="bginput" name="vb_login_username" size="25" accesskey="u" tabindex="1" /></td>
                                        </tr>
                                                                                <br /><br />
                                        <tr>
                                            <td>$vbphrase[password]:<br /><input type="password" class="bginput" name="vb_login_password" size="25" tabindex="1" /></td>
                                        </tr>
                                        <tr>
                                            <td>
                                                <label for="cb_cookieuser"><input type="checkbox" name="cookieuser" value="1" id="cb_cookieuser" tabindex="1" />$vbphrase[remember_me]</label>
                                            </td>
                                        </tr>
                                        <tr>
                                            <td align="$stylevar[center]">
                                                                                        <br /><br /><br />
                                                <div align="center"><input type="submit" class="va-button-b2" value="$vbphrase[log_in]" accesskey="s" tabindex="1" /></div>
                                            </td>
                                        </tr>
                                    </table>
                                                                        <input type="hidden" name="do" value="login" />
                                <input type="hidden" name="url" value="$vboptions[bburl]" />
                                <input type="hidden" name="vb_login_md5password" />
                                <input type="hidden" name="vb_login_md5password_utf" />
                                <input type="hidden" name="mapfb" value="true" />
                                <input type="hidden" name="s" value="$session[sessionhash]" />
                                <input type="hidden" name="securitytoken" value="$bbuserinfo[securitytoken]" />
                            </form>
                                               
        </td>

Thank you again

ozzy47 03-14-2014 09:32 PM

I think you may need to change this:
Code:

<input type="hidden" name="url" value="$vboptions[bburl]" />
To this:
Code:

<input type="hidden" name="url" value="$scriptpath" />

A.Chakery 03-14-2014 09:49 PM

Thank you for the reply,

But there is a bug issue with "$scriptpath", if I use this variable it will redirects the user to the login page again after signing in not the previous URL.

ozzy47 03-14-2014 09:53 PM

Hmmmm, so your site has no quick login box, it is a separate form for them to log in from? If that is the case, then I don't believe you can send them back two pages, but I am not totally sure.

A.Chakery 03-15-2014 06:59 AM

Yes, because of the performance issues I have removed the quick login box on all pages and its a separate sign-in page.

Well, is it possible that I use this action : "onClick="history.go(-2)" in some way ?

thank you for the help


All times are GMT. The time now is 11:35 AM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.02656 seconds
  • Memory Usage 1,747KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (2)bbcode_code_printable
  • (1)bbcode_html_printable
  • (1)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (7)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete