MyBB Community Forums

Full Version: Redirection issue, from header login
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hello all,

My problem is that i have a login option on the page header, that appears on every page of the forum. But using that to login redirects user to the index page. Here is my website: http://www.pak-photographers.com/

The problem is same as:
http://community.mybb.com/thread-126778.html

But my theme is different than him so i need help regarding my template... i was not sure whether to post there or to make a new thread.. So i made a new one.


I would like 'euantor' or any other member to help me solve this issue.. Here is my 'header_welcomeblock_guest' template.

<div style="padding-top: 20px; padding-left: 10px; padding-right: 10px;">

<div style="float: left;">


     <form action="member.php" method="post">
&nbsp; Hello There, Guest!!
<input type="text" class="login" name="username" value="Username" onfocus="if(this.value == 'Username') { this.value = ''; }" size="25" maxlength="{$mybb->settings['maxnamelength']}" style=" color: #595641; background-image: url({$theme['imgdir']}/input_box.png); background-repeat: repeat-x; width: 120px; height: 15px; padding: 3px 0px 2px 0px; border-top: 1px solid #66624a; border-left: 1px solid #66624a; border-right: 1px solid #b5af89; border-bottom: 1px solid #b5af89;"/>
<input type="password" class="login" name="password" value="password" onfocus="if(this.value == 'password') { this.value = ''; }" style=" color: #595641; background-image: url({$theme['imgdir']}/input_box.png); background-repeat: repeat-x; width: 120px; height: 15px; padding: 3px 0px 2px 0px; border-top: 1px solid #66624a; border-left: 1px solid #66624a; border-right: 1px solid #b5af89; border-bottom: 1px solid #b5af89;"/>
<input type="submit" class="button" name="submit" value="" style="background-image: url({$theme['imgdir']}/buttons/login.png); background-repeat: no-repeat; width: 60px; height: 22px; border: 0px;"/>
<input type="hidden" name="action" value="do_login" />
<input type="hidden" name="url" value="{$redirect_url}" />
     </form>
</div>
<span class="remember_me"><input name="quick_remember" type="checkbox" checked="checked" value="yes" class="checkbox" id="quick_login_remember"><label for="quick_login_remember"> Remember me</label></span>


     <div style="float: right;">
     <div style="padding-top: 0px; padding-left: 5px; padding-right: 10px;">
 <span style="float: right;">{$lang->welcome_current_time}</span><br />
<b><a href="{$mybb->settings['bburl']}/member.php?action=register">{$lang->welcome_register}</a> | <a href="{$mybb->settings['bburl']}/member.php?action=lostpw">{$lang->lost_password}</a></b>


     </div>
     </div>
</div>
Using Euantor's method, this should work:

<div style="padding-top: 20px; padding-left: 10px; padding-right: 10px;">

<div style="float: left;">


     <form action="member.php" method="post">
&nbsp; Hello There, Guest!!
<input type="text" class="login" name="username" value="Username" onfocus="if(this.value == 'Username') { this.value = ''; }" size="25" maxlength="{$mybb->settings['maxnamelength']}" style=" color: #595641; background-image: url({$theme['imgdir']}/input_box.png); background-repeat: repeat-x; width: 120px; height: 15px; padding: 3px 0px 2px 0px; border-top: 1px solid #66624a; border-left: 1px solid #66624a; border-right: 1px solid #b5af89; border-bottom: 1px solid #b5af89;"/>
<input type="password" class="login" name="password" value="password" onfocus="if(this.value == 'password') { this.value = ''; }" style=" color: #595641; background-image: url({$theme['imgdir']}/input_box.png); background-repeat: repeat-x; width: 120px; height: 15px; padding: 3px 0px 2px 0px; border-top: 1px solid #66624a; border-left: 1px solid #66624a; border-right: 1px solid #b5af89; border-bottom: 1px solid #b5af89;"/>
<input type="submit" class="button" name="submit" value="" style="background-image: url({$theme['imgdir']}/buttons/login.png); background-repeat: no-repeat; width: 60px; height: 22px; border: 0px;"/>
<input type="hidden" name="action" value="do_login" />
<input type="hidden" name="url" value="{$redirect_url}" id="redirectURLTextbox" />
     </form>
</div>
<span class="remember_me"><input name="quick_remember" type="checkbox" checked="checked" value="yes" class="checkbox" id="quick_login_remember"><label for="quick_login_remember"> Remember me</label></span>


     <div style="float: right;">
     <div style="padding-top: 0px; padding-left: 5px; padding-right: 10px;">
<span style="float: right;">{$lang->welcome_current_time}</span><br />
<b><a href="{$mybb->settings['bburl']}/member.php?action=register">{$lang->welcome_register}</a> | <a href="{$mybb->settings['bburl']}/member.php?action=lostpw">{$lang->lost_password}</a></b>


     </div>
     </div>
</div>

<script type="text/javascript">
window.onload = function()
{
    var urlTextbox = document.getElementById('redirectURLTextbox');
    if (urlTextbox)
    {
     urlTextbox.value = window.location;
    }
 }
 </script>
(2012-10-28, 10:22 AM)Vernier Wrote: [ -> ]Using Euantor's method, this should work:

<div style="padding-top: 20px; padding-left: 10px; padding-right: 10px;">

<div style="float: left;">


     <form action="member.php" method="post">
&nbsp; Hello There, Guest!!
<input type="text" class="login" name="username" value="Username" onfocus="if(this.value == 'Username') { this.value = ''; }" size="25" maxlength="{$mybb->settings['maxnamelength']}" style=" color: #595641; background-image: url({$theme['imgdir']}/input_box.png); background-repeat: repeat-x; width: 120px; height: 15px; padding: 3px 0px 2px 0px; border-top: 1px solid #66624a; border-left: 1px solid #66624a; border-right: 1px solid #b5af89; border-bottom: 1px solid #b5af89;"/>
<input type="password" class="login" name="password" value="password" onfocus="if(this.value == 'password') { this.value = ''; }" style=" color: #595641; background-image: url({$theme['imgdir']}/input_box.png); background-repeat: repeat-x; width: 120px; height: 15px; padding: 3px 0px 2px 0px; border-top: 1px solid #66624a; border-left: 1px solid #66624a; border-right: 1px solid #b5af89; border-bottom: 1px solid #b5af89;"/>
<input type="submit" class="button" name="submit" value="" style="background-image: url({$theme['imgdir']}/buttons/login.png); background-repeat: no-repeat; width: 60px; height: 22px; border: 0px;"/>
<input type="hidden" name="action" value="do_login" />
<input type="hidden" name="url" value="{$redirect_url}" id="redirectURLTextbox" />
     </form>
</div>
<span class="remember_me"><input name="quick_remember" type="checkbox" checked="checked" value="yes" class="checkbox" id="quick_login_remember"><label for="quick_login_remember"> Remember me</label></span>


     <div style="float: right;">
     <div style="padding-top: 0px; padding-left: 5px; padding-right: 10px;">
<span style="float: right;">{$lang->welcome_current_time}</span><br />
<b><a href="{$mybb->settings['bburl']}/member.php?action=register">{$lang->welcome_register}</a> | <a href="{$mybb->settings['bburl']}/member.php?action=lostpw">{$lang->lost_password}</a></b>


     </div>
     </div>
</div>

<script type="text/javascript">
window.onload = function()
{
    var urlTextbox = document.getElementById('redirectURLTextbox');
    if (urlTextbox)
    {
     urlTextbox.value = window.location;
    }
 }
 </script>


I m sorry this is not working Sad
Are you sure you've updated the header_welcomeblock_guest template with the code I gave above for the correct theme? Looking at your source code, I'm still seeing:

				
<div style="padding-top: 20px; padding-left: 10px; padding-right: 10px;">

<div style="float: left;">


     <form action="member.php" method="post">
&nbsp; Hello There, Guest!!
<input type="text" class="login" name="username" value="Username" onfocus="if(this.value == 'Username') { this.value = ''; }" size="25" maxlength="30" style=" color: #595641; background-image: url(images/royal_blue/input_box.png); background-repeat: repeat-x; width: 120px; height: 15px; padding: 3px 0px 2px 0px; border-top: 1px solid #66624a; border-left: 1px solid #66624a; border-right: 1px solid #b5af89; border-bottom: 1px solid #b5af89;"/>
<input type="password" class="login" name="password" value="password" onfocus="if(this.value == 'password') { this.value = ''; }" style=" color: #595641; background-image: url(images/royal_blue/input_box.png); background-repeat: repeat-x; width: 120px; height: 15px; padding: 3px 0px 2px 0px; border-top: 1px solid #66624a; border-left: 1px solid #66624a; border-right: 1px solid #b5af89; border-bottom: 1px solid #b5af89;"/>
<input type="submit" class="button" name="submit" value="" style="background-image: url(images/royal_blue/buttons/login.png); background-repeat: no-repeat; width: 60px; height: 22px; border: 0px;"/>
<input type="hidden" name="action" value="do_login" />
<input type="hidden" name="url" value="" />
     </form>
</div>
<span class="remember_me"><input name="quick_remember" type="checkbox" checked="checked" value="yes" class="checkbox" id="quick_login_remember"><label for="quick_login_remember"> Remember me</label></span>


     <div style="float: right;">
     <div style="padding-top: 0px; padding-left: 5px; padding-right: 10px;">
 <span style="float: right;"><strong>Current time:</strong> 28-10-2012, 03:49 PM</span><br />
<b><a href="http://www.pak-photographers.com/member.php?action=register">Register</a> | <a href="http://www.pak-photographers.com/member.php?action=lostpw">Lost Password?</a></b>


     </div>
     </div>
</div>
Oh i actully undid it. Check now , i have updated it again. (its not working)

Wait, its working Big Grin

Thank you Vernier for quick and useful support.
What happened was that when i was copying and pasting your code, it was being pasted in a single line with lots of '&nsbp'.

Then i first copied it to notepad and then from notepad to editor, and it pasted the same format Smile and it worked.

Thank you so much once again Big Grin