Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

loginbox ,add password forgotten


Guest

Recommended Posts

I have been trying to add password forgoteen to the loginbox, so far I came up with this , but it just runns the same submit as login, I know I need to separate the codes, just what to is giving me a headache

here is the login code

 

<?php

/*

 

osCommerce, Open Source E-Commerce Solutions

http://www.oscommerce.com

 

Copyright © 2002 osCommerce

 

Released under the GNU General Public License

 

 

IMPORTANT NOTE:

 

This script is not part of the official osC distribution

but an add-on contributed to the osC community. Please

read the README and INSTALL documents that are provided

with this file for further information and installation notes.

 

 

loginbox.php - Version 1.0

 

This puts a login request in a box with a login button.

 

If already logged in, will not show anything.

 

 

 

 

 

*/

?>

<!-- loginbox //-->

<?php

if (!tep_session_is_registered('customer_id')) {

?>

<tr>

<td>

<?php

$info_box_contents = array();

$info_box_contents[] = array('align' => 'left',

'text' => BOX_LOGINBOX_HEADING

);

new infoBoxHeading($info_box_contents, false, false);

 

$loginboxcontent = "

 

<table border="0" width="100%" cellspacing="0" cellpadding="0">

 

<form name="login" method="post" action="" . tep_href_link(FILENAME_LOGIN, 'action=process', 'SSL') . "">

 

<tr>

<td align="left" class="main">

 

" . BOX_LOGINBOX_EMAIL . "

 

</td>

 

</tr>

 

<tr>

<td align="left" class="main">

 

<input type="text" name="email_address" maxlength="96" size="20" value="">

 

</td>

 

</tr>

 

<tr>

<td align="left" class="main">

 

" . BOX_LOGINBOX_PASSWORD . "

 

</td>

 

</tr>

 

<tr>

<td align="left" class="main">

 

<input type="password" name="password" maxlength="40" size="20" value=""

</td>

 

</tr>

 

<tr>

 

<td class="main" valign="top" align="center">

 

" . tep_image_submit('button_login.jpg', IMAGE_BUTTON_LOGIN) . "

 

</td>

 

</tr>

 

<td CLASS="main" valign="bottom" ALIGN="center">

" . tep_image_submit('button_password_forgotten.jpg', IMAGE_BUTTON_PASSWORD_FORGOTTEN) . "

</td>

</tr>

</form>

 

</table>

 

";

 

$info_box_contents = array();

$info_box_contents[] = array('align' => 'center',

'text' => $loginboxcontent

);

new infoBox($info_box_contents);

?>

</td>

</tr>

<?php

}

else

{

// If you want to display anything when the user IS logged in, put it

// in here... Possibly a "You are logged in as :" box or something.

}

?>

 

<!-- loginbox_eof //-->

Link to comment
Share on other sites

add a </form> tag here:

 

<td class="main" valign="top" align="center"> 



" . tep_image_submit('button_login.jpg', IMAGE_BUTTON_LOGIN) . " 



</form></td> 



</tr>

Link to comment
Share on other sites

Not I still need to get the password forgoteen part to take me to that page

I can't use a href, it takes the loginbox out

Link to comment
Share on other sites

Oh yes... sorry, I didn't look at that, just knew straight away that you had a missing form tag... you must draw another form for the password forgotten... look at how its done in login.php

Link to comment
Share on other sites

I put in another form and it took out the loginbox, here's the code I put in

 

<?php

/*

 

osCommerce, Open Source E-Commerce Solutions

http://www.oscommerce.com

 

Copyright © 2002 osCommerce

 

Released under the GNU General Public License

 

 

IMPORTANT NOTE:

 

This script is not part of the official osC distribution

but an add-on contributed to the osC community. Please

read the README and INSTALL documents that are provided

with this file for further information and installation notes.

 

 

loginbox.php - Version 1.0

 

This puts a login request in a box with a login button.

 

If already logged in, will not show anything.

 

 

 

 

 

*/

?>

<!-- loginbox //-->

<?php

if (!tep_session_is_registered('customer_id')) {

?>

<tr>

<td>

<?php

$info_box_contents = array();

$info_box_contents[] = array('align' => 'left',

'text' => BOX_LOGINBOX_HEADING

);

new infoBoxHeading($info_box_contents, false, false);

 

$loginboxcontent = "

 

<table border="0" width="100%" cellspacing="0" cellpadding="0">

 

<form name="login" method="post" action="" . tep_href_link(FILENAME_LOGIN, 'action=process', 'SSL') . "">

 

<tr>

<td align="left" class="main">

 

" . BOX_LOGINBOX_EMAIL . "

 

</td>

 

</tr>

 

<tr>

<td align="left" class="main">

 

<input type="text" name="email_address" maxlength="96" size="20" value="">

 

</td>

 

</tr>

 

<tr>

<td align="left" class="main">

 

" . BOX_LOGINBOX_PASSWORD . "

 

</td>

 

</tr>

 

<tr>

<td align="left" class="main">

 

<input type="password" name="password" maxlength="40" size="20" value=""

</td>

 

</tr>

 

<tr>

 

<td class="main" valign="top" align="center">

 

" . tep_image_submit('button_login.jpg', IMAGE_BUTTON_LOGIN) . "

 

</td>

 

</tr></form>

<form name="login" METHOD="post" action="" . tep_href_link(FILENAME_PASSWORD_FORGOTTEN, 'action=process', SSL') . "">

<td CLASS="main" valign="bottom" ALIGN="center">

" . tep_image_submit('button_password_forgotten.jpg', IMAGE_BUTTON_PASSWORD_FORGOTTEN) . "

</td>

</tr>

</form>

 

</table>

 

";

 

$info_box_contents = array();

$info_box_contents[] = array('align' => 'center',

'text' => $loginboxcontent

);

new infoBox($info_box_contents);

?>

</td>

</tr>

<?php

}

else

{

// If you want to display anything when the user IS logged in, put it

// in here... Possibly a "You are logged in as :" box or something.

}

?>

 

<!-- loginbox_eof //-->

Link to comment
Share on other sites

Hmmm... bit early in the morning for me I think :shock: .... login.php simply has a link:

 

                    <td class="smallText" colspan="2"><?php echo '<a href="' . tep_href_link(FILENAME_PASSWORD_FORGOTTEN, '', 'SSL') . '">' . TEXT_PASSWORD_FORGOTTEN . '</a>'; ?></td>

Link to comment
Share on other sites

Heres the text from the editor,

<?php

/*

 

osCommerce, Open Source E-Commerce Solutions

http://www.oscommerce.com

 

Copyright © 2002 osCommerce

 

Released under the GNU General Public License

 

 

IMPORTANT NOTE:

 

This script is not part of the official osC distribution

but an add-on contributed to the osC community. Please

read the README and INSTALL documents that are provided

with this file for further information and installation notes.

 

 

loginbox.php - Version 1.0

 

This puts a login request in a box with a login button.

 

If already logged in, will not show anything.

 

 

 

 

 

*/

?>

<!-- loginbox //-->

<?php

if (!tep_session_is_registered('customer_id')) {

?>

<tr>

<td>

<?php

$info_box_contents = array();

$info_box_contents[] = array('align' => 'left',

'text' => BOX_LOGINBOX_HEADING

);

new infoBoxHeading($info_box_contents, false, false);

 

$loginboxcontent = "

 

<table border="0" width="100%" cellspacing="0" cellpadding="0">

 

<form name="login" method="post" action="" . tep_href_link(FILENAME_LOGIN, 'action=process', 'SSL') . "">

 

<tr>

<td align="left" class="main">

 

" . BOX_LOGINBOX_EMAIL . "

 

</td>

 

</tr>

 

<tr>

<td align="left" class="main">

 

<input type="text" name="email_address" maxlength="96" size="20" value="">

 

</td>

 

</tr>

 

<tr>

<td align="left" class="main">

 

" . BOX_LOGINBOX_PASSWORD . "

 

</td>

 

</tr>

 

<tr>

<td align="left" class="main">

 

<input type="password" name="password" maxlength="40" size="20" value=""

</td>

 

</tr>

 

</form><tr>

<td CLASS="smallText" colspan="2"><?php echo '<a href="' . tep_href_link(FILENAME_PASSWORD_FORGOTTEN, '' , 'SSL') . '">' . TEXT_PASSWORD_FORGOTTEN . '</a>'; ?></td>

</td>

</tr>

</form>

 

</table>

 

";

 

$info_box_contents = array();

$info_box_contents[] = array('align' => 'center',

'text' => $loginboxcontent

);

new infoBox($info_box_contents);

?>

</td>

</tr>

<?php

}

else

{

// If you want to display anything when the user IS logged in, put it

// in here... Possibly a "You are logged in as :" box or something.

}

?>

 

<!-- loginbox_eof //-->

 

Every time I try to write a link, it screws up the box

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...