X-Cart: shopping cart software

X-Cart forums (https://forum.x-cart.com/index.php)
-   Changing design (https://forum.x-cart.com/forumdisplay.php?f=51)
-   -   Login form will not work? Any Ideas? (https://forum.x-cart.com/showthread.php?t=10182)

elabdesigns 11-03-2004 11:14 AM

Login form will not work? Any Ideas?
 
I made this form for my custom login page. All of the logic seems right but from some reason it doesn't work? Any thoughts as to why?

Code:



If you already have an account, please login by filling in the form below.</p>
<table border=0>
  <FORM action="{$xcart_web_dir}/include/login.php" method="post" name="loginform">
    <tr>
      <td height="10" width="78" class=FormButton>Login</td>
      <td width="282" height="10"><input type="text" name="username" size="30">
      </td>
    </tr>
    <tr>
      <td height="10" width="78" class=FormButton>Password</td>
      <td width="282" height="10"><input type="password" name="password" size="30">
      <input type="hidden" name="usertype" value="C">
      </td>
    </tr>
    <tr>
      <td height="10" width="78"></td>
      <td width="282" height="10"></td>
    </tr>
    <tr>
      <td height="10" width="78"></td>
      <td width="282" height="10">LOG IN
      </td>
    </tr>
    <INPUT type="hidden" name="mode" value="logout">
    <INPUT type="hidden" name="redirect" value="{$redirect}">
  </FORM>
</table>


 If you do not have an account, you can easily register here</font>


Jon 11-03-2004 11:45 AM

<INPUT type="hidden" name="mode" value="logout">

Your mode is going to log you out instead of in.

elabdesigns 11-03-2004 12:09 PM

Jon, thanks it worked!

It logs me in but for from some reason when you log in it doesn't redirect you like it does when you login using the /error_message.php?login_incorrect script? I have a call to redirect? is it wrong?

Code:

<INPUT type="hidden" name="redirect" value="{$redirect}">

Jon 11-03-2004 12:15 PM

Load the page and see what the actual redirect value is.

elabdesigns 11-03-2004 12:19 PM

Jon, is guess my brain is on break because I am not following?

What should I look for?

The site is an extreme work in progress - but see what you can make of it

http://www.pariscape.com/pages.php?pageid=3[/url]

Jon 11-03-2004 02:02 PM

When you go to that page and you view source you'll see:

<INPUT type="hidden" name="redirect" value="{$redirect}">

That means that your page isn't processing your smarty, so you need to specify this value.

Try:

<input type=hidden name=redirect value="customer">

elabdesigns 11-04-2004 06:55 AM

Didn't work
 
Jon

Thanks for the replies, but that didn't fix the problem either. Any more ideas? Or how I can change the form/make a form to log in on and or register?

Thanks

Jon 11-04-2004 10:02 AM

Depends what x-cart version your using.

I would just include the auth.tpl in a smarty template.

elabdesigns 11-05-2004 07:23 AM

Jon-

I would like to thank you for all the help you have given me thus far. Can you help me even further.

Can you tell me how do make a smarty template and include the auth.tpl like you suggested?

I have tried it all, from making my own myaccoun.php to everthing under the moon. All will not redirect

Jon 11-05-2004 08:07 AM

What version are you running?

elabdesigns 11-05-2004 08:20 AM

I am running 4.0.6 gold

Jon 11-05-2004 08:37 AM

1) Download home.php and rename it myaccount.php

2) Open myaccount.php

Find:

Code:

$smarty->assign("main","catalog");

Change to:

Code:

$smarty->assign("main","myaccount");

3) Open: /skin1/customer/home_main.tpl

Find:

Code:

{else}
{include file="common_templates.tpl"}
{/if}


BEFORE that add:

Code:

{elseif $main eq "myaccount"}
{include file="customer/main/myaccount.tpl"}


4) Create a new file called: myaccount.tpl

In it put this code:

Code:

<h3>{$lng.lbl_authentication}</h3>

<table border="0" width="100%" cellpadding="2">
<tr>
<td valign="top">
{capture name=dialog}

<TABLE border="0">
{if $config.General.use_https_login eq "Y" and $usertype eq "C"}
{assign var="form_url" value=$https_location}
{else}
{assign var="form_url" value=$current_location}
{/if}
<FORM action="{$form_url}/include/login.php" method="post" name=errorform>
<TR>
<TD height="10" width="78" class="FormButton">{$lng.lbl_login}</TD>
<TD width="10" height="10"><FONT class="Star">*</FONT></TD>
<TD width="282" height="10">
<INPUT type="text" name="username" size="30">
</TD>
</TR>
<TR>
<TD height="10" width="78" class="FormButton">{$lng.lbl_password}</TD>
<TD width="10" height="10"><FONT class="Star">*</FONT></TD>
<TD width="282" height="10">
<INPUT type="password" name="password" size="30">
{if $active_modules.Simple_Mode ne "" and $usertype ne "C" and $usertype ne "B"}
<INPUT type="hidden" name="usertype" value="P">
{else}
<INPUT type="hidden" name="usertype" value="{$usertype}">
{/if}
<INPUT type="hidden" name="redirect" value="{$redirect}">
<INPUT type="hidden" name="mode" value="login">
</TD>
</TR>
<TR>
<TD height="10" width="78" class="FormButton"></TD>
<TD width="10" height="10"></TD>
<TD width="282" height="10" class="ErrorMessage">
{ if $main eq "login_incorrect"}
{$lng.err_invalid_login}
{/if}
</TD>
</TR>
<TR>
<TD height="10" width="78" class="FormButton"></TD>
<TD width="10" height="10" class="FormButton"></TD>
<TD width="282" height="10">
{if $js_enabled}
{include file="buttons/submit.tpl" href="javascript:document.errorform.submit()" js_to_href="Y"}
{else}
{include file="submit_wo_js.tpl" value=$lng.lbl_submit}
{/if}
</TD>
</TR>
</FORM>
</TABLE>
{/capture}
{include file="dialog.tpl" title=$lng.lbl_authentication content=$smarty.capture.dialog extra="width=100%"}
</td>
</tr>
<tr>
<td valign="top">
{include file="customer/main/register.tpl"}
</td>
</tr>
</table>


5) Upload myaccount.php to the same directory as your home.php

6) Reupload home_main.tpl to the same place

7) Upload myaccount.tpl to /skin1/customer/main/

8) Load your myaccount.php in your browser.

elabdesigns 11-05-2004 01:24 PM

Jon,

Your almost there, or I am at least. I followed your directions to the T. However, once you click login it returns you back to the login screen. Why?

Why does http://www.pariscape.com/error_message.php?login_incorrect redirect you from the login page back to the home page and your script won't? I don't want them seeing the login screen after they login.

What does that form do differently that you don't?

The site is under major contruction, but please look at:

http://www.pariscape.com/myaccount.php

login in as customer:customer


Thanks :wink:

Jon 11-05-2004 01:31 PM

Open myaccount.php

Find:

Code:

require "./auth.php";

After put:

Code:

if ($login) { header ("Location: /home.php"); }

Jon 11-06-2004 10:01 PM

That work?

elabdesigns 11-07-2004 08:27 AM

Yes! Thanks Jon for all your help.

chris 11-11-2004 11:46 AM

Well done Jon
 
Well Jon you do rather beat the drum about your add-ons :D but I must praise you for the time you give to this forum - I followed the whole thread and just felt I had to congratulate you for all the work you did in helping the poster without any reward - thanks on behalf of the forum!!
(moderators I hope you don't mind my saying on behalf of the forum - I just feel Jon really deserves it!!)

Jon 11-12-2004 01:17 AM

Thanks 8)

EnriqueHavoc 11-12-2004 02:46 AM

there should be like a bi-monthly poll where we vote on the most helpful member on the forums and all chip in for some kind of "thank you" prize


All times are GMT -8. The time now is 02:23 AM.

Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.