Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

login and logout for non oscommerce page


Dodi

Recommended Posts

Hello, I'm new here, so nice to meet you all.

 

I need a thing that says "Login / Register" when the user is not logged in and "Logout" when they are.

However I want this to go on a non-oscommerce page.

 

Does anyone have any idea how to do this?

 

Thanks

Link to comment
Share on other sites

if (!tep_session_is_registered('customer_id'))

//showlogin/register

 

else

//show logout

Ask/Skype for Free osCommerce value addon/SEO suggestion tips for your site.

 

Check My About US For who am I and what My company does.

Link to comment
Share on other sites

if (!tep_session_is_registered('customer_id'))

//showlogin/register

 

else

//show logout

 

Thanks for the quick reply, however all it does is show up as text :(

Any other idea's?

 

Again Thanks :D

Link to comment
Share on other sites

<?php if (tep_session_is_registered('customer_id')) { ?><a href="<?php echo tep_href_link(FILENAME_LOGOFF, '', 'SSL'); }

 

?>

Ask/Skype for Free osCommerce value addon/SEO suggestion tips for your site.

 

Check My About US For who am I and what My company does.

Link to comment
Share on other sites

oooo Getting closer.

I now receive this error:

 

Fatal error: Call to undefined function tep_session_is_registered() in C:\wamp\www\website\index.php on line 208

 

Any idea what this means?

Link to comment
Share on other sites

post your code

A great place for newbies to start

Road Map to oscommerce File Structure

DO NOT PM ME FOR HELP. My time is valuable, unless i ask you to PM me, please dont. You will get better help if you post publicly. I am not as good at this as you think anyways!

 

HOWEVER, you can visit my blog (go to my profile to see it) and post a question there, i will find time to get back and answer you

 

Proud Memeber of the CODE BREAKERS CLUB!!

Link to comment
Share on other sites

post your code

 

Ok, but its very long, and like I said its not a oscommerce page.

 

Thanks for all the help! :D

 

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Jado Games - Closed</title>
<style type="text/css"> 
<!-- 
body  {
font: 100% Verdana, Arial, Helvetica, sans-serif;
background: #666666;
margin: 0; /* it's good practice to zero the margin and padding of the body element to account for differing browser defaults */
padding: 0;
text-align: center; /* this centers the container in IE 5* browsers. The text is then set to the left aligned default in the #container selector */
color: #000000;
background-color: #000000;
background-image: url();
}
.thrColFixHdr #container {
width: 1000px;  /* using 20px less than a full 800px width allows for browser chrome and avoids a horizontal scroll bar */
background: #3a3a3a;
margin: 0 auto; /* the auto margins (in conjunction with a width) center the page */
border: 0px solid #000000;
text-align: left; /* this overrides the text-align: center on the body element. */
font-size: 12px;
background-repeat: no-repeat;
} 
.thrColFixHdr #header { 
background: #DDDDDD; 
padding: 0 10px 0 20px;  /* this padding matches the left alignment of the elements in the divs that appear beneath it. If an image is used in the #header instead of text, you may want to remove the padding. */
} 
.thrColFixHdr #header h1 {
margin: 0; /* zeroing the margin of the last element in the #header div will avoid margin collapse - an unexplainable space between divs. If the div has a border around it, this is not necessary as that also avoids the margin collapse */
padding: 10px 0; /* using padding instead of margin will allow you to keep the element away from the edges of the div */
}
.thrColFixHdr #sidebar1 {
float: left; /* since this element is floated, a width must be given */
width: 180px; /* the actual width of this div, in standards-compliant browsers, or standards mode in Internet Explorer will include the padding and border in addition to the width */
background: #3a3a3a; /* the background color will be displayed for the length of the content in the column, but no further */
padding: 15px 10px 15px 0px; /* padding keeps the content of the div away from the edges */
font-size: 12px;
background-repeat: no-repeat;
}
.thrColFixHdr #sidebar2 {
float: right; /* since this element is floated, a width must be given */
width: 180px; /* the actual width of this div, in standards-compliant browsers, or standards mode in Internet Explorer will include the padding and border in addition to the width */
background: #3a3a3a; /* the background color will be displayed for the length of the content in the column, but no further */
padding: 15px 10px 15px 20px; /* padding keeps the content of the div away from the edges */
}
.thrColFixHdr #mainContent {
margin: 0 200px; /* the right and left margins on this div element creates the two outer columns on the sides of the page. No matter how much content the sidebar divs contain, the column space will remain. You can remove this margin if you want the #mainContent div's text to fill the sidebar spaces when the content in each sidebar ends. */
padding: 0 15px; /* remember that padding is the space inside the div box and margin is the space outside the div box */
border: 1px;
} 
.thrColFixHdr #footer {
padding: 0 10px 0 20px; /* this padding matches the left alignment of the elements in the divs that appear above it. */
background:#DDDDDD;
font-size: 10px;
} 
.thrColFixHdr #footer p {
margin: 0; /* zeroing the margins of the first element in the footer will avoid the possibility of margin collapse - a space between divs */
padding: 5px 0; /* padding on this element will create space, just as the the margin would have, without the margin collapse issue */
}
.fltrt { /* this class can be used to float an element right in your page. The floated element must precede the element it should be next to on the page. */
float: right;
margin-left: 8px;
}
.fltlft { /* this class can be used to float an element left in your page */
float: left;
margin-right: 8px;
}
.clearfloat { /* this class should be placed on a div or break element and should be the final element before the close of a container that should fully contain a float */
clear:both;
height:0;
font-size: 1px;
line-height: 0px;
}
--> 
</style><!--[if IE 5]>
<style type="text/css"> 
/* place css box model fixes for IE 5* in this conditional comment */
.thrColFixHdr #sidebar1 { width: 180px; }
.thrColFixHdr #sidebar2 { width: 190px; }
</style>
<![endif]--><!--[if IE]>
<style type="text/css"> 
/* place css fixes for all versions of IE in this conditional comment */
.thrColFixHdr #sidebar2, .thrColFixHdr #sidebar1 { padding-top: 30px; }
.thrColFixHdr #mainContent { zoom: 1; }
/* the above proprietary zoom property gives IE the hasLayout it needs to avoid several bugs */
</style>
<![endif]-->
<script src="Scripts/AC_RunActiveContent.js" type="text/javascript"></script>
<script src="SpryAssets/SpryMenuBar.js" type="text/javascript"></script>
<style type="text/css">
<!--
.style3 {
color: #FFFFFF;
font-weight: bold;
}
-->
</style>
<link href="SpryAssets/SpryMenuBarHorizontal.css" rel="stylesheet" type="text/css" />
<link href="SpryAssets/SpryMenuBarVertical.css" rel="stylesheet" type="text/css" />
<style type="text/css">
<!--
.style5 {
font-family: Arial, Helvetica, sans-serif;
font-weight: bold;
}
.style6 {font-family: Arial, Helvetica, sans-serif}
-->
</style>
</head>

<body class="thrColFixHdr">
<script type="text/javascript">
AC_FL_RunContent( 'codebase','http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,28,0','width','1000','height','150','src','Flash/banner','quality','high','pluginspage','http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash','movie','Flash/banner' ); //end AC code
</script>
<noscript><object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,28,0" width="1000" height="150">
 <param name="movie" value="Flash/banner.swf" />
 <param name="quality" value="high" />
 <embed src="Flash/banner.swf" quality="high" pluginspage="http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash" type="application/x-shockwave-flash" width="1000" height="150"></embed>
</object></noscript>
<script type="text/javascript">
AC_FL_RunContent( 'codebase','http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,28,0','width','1000','height','13','src','Flash/under-banner','quality','high','pluginspage','http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash','movie','Flash/under-banner' ); //end AC code
</script><noscript><object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,28,0" width="1000" height="13">
 <param name="movie" value="Flash/under-banner.swf" />
 <param name="quality" value="high" />
 <embed src="Flash/under-banner.swf" quality="high" pluginspage="http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash" type="application/x-shockwave-flash" width="1000" height="13"></embed>
</object></noscript>
<div id="container">
 <div id="sidebar1">
<!-- end #sidebar1 -->
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
</div>
 <div id="sidebar2">
<h3><br />
  <br />
	  <br />
	  <br />
	  <br />
	  <br />
	  <br />
<br />
</h3>
 <!-- end #sidebar2 --></div>
 <!-- This clearing element should immediately follow the #mainContent div in order to force the #container div to contain all child floats -->
 <div class="thrColFixHdr">

<div align="center">
	<div id="mainContent">
	<ul id="MenuBar1" class="MenuBarHorizontal">
		<li class="style5"><a href="/index.php">Home</a> </li>
		<li> <a href="/games.php" class="MenuBarItemSubmenu style6"><strong>PC Games</strong></a>
			<ul>
			  <li><a href="#">RPG</a></li>
			  <li><a href="#">Action</a></li>
			  <li><a href="#">Stratagy</a></li>
			  <li><a href="#">Simulation</a></li>
			  <li><a href="#">Online</a></li>
			  <li><a href="#">All Games</a></li>
			</ul>
	  </li>
		<li> <a href="/account.php" class="MenuBarItemSubmenu style6"><strong>Your Account</strong></a>
			<ul>
			  <li><a href="/account_edit.php">Details</a></li>
			  <li><a href="#">Purchases</a></li>
			  <li><a class="MenuBarItemSubmenu" href="#">Edit your account</a>
				  <ul>
					<li><a href="#">Details</a></li>
					<li><a href="#">Address</a></li>
					<li><a href="#">Password</a></li>
				</ul>
			  </li>
			</ul>
		</li>
		<li> <a href="#" class="style3 MenuBarItemSubmenu style6">Downloads</a>
		  <ul>
			<li><a href="#">Patches</a></li>
			<li><a href="#">Guides</a></li>
		  </ul>
	  </li>
	  </ul><br /><br /><br /></div>
  <script type="text/javascript">
AC_FL_RunContent( 'codebase','http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,28,0','width','550','height','300','src','Flash/Untitled-1','quality','high','pluginspage','http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash','wmode','opaque','movie','Flash/Untitled-1' ); //end AC code
</script><noscript><object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,28,0" width="550" height="300">
		  <param name="movie" value="Flash/Untitled-1.swf" />
		  <param name="quality" value="high" />
		  <param name="wmode" value="opaque">
		  <embed src="Flash/Untitled-1.swf" quality="high" pluginspage="http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash" type="application/x-shockwave-flash" wmode="opaque" width="550" height="300"></embed>
		</object>
	  </noscript>
<span class="style3"><br />
	<br />
  Welcome to Jado Games!<br />
Please be paitent while we design the site, ready for opening.</span></div>
</div>
 <div align="center">
 <br />
<br />
 </div>
 <div class="thrColFixHdr">
  <div align="center">
	<script type="text/javascript">
AC_FL_RunContent( 'codebase','http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,28,0','width','800','height','300','src','Flash/Bottom-select','quality','high','pluginspage','http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash','movie','Flash/Bottom-select' ); //end AC code
</script><noscript><object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,28,0" width="800" height="300">
	  <param name="movie" value="Flash/Bottom-select.swf" />
	  <param name="quality" value="high" />
	  <embed src="Flash/Bottom-select.swf" quality="high" pluginspage="http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash" type="application/x-shockwave-flash" width="800" height="300"></embed>
	</object>
  </noscript></div>
 </div>
<br />
<br class="clearfloat" />
 <div id="footer">
<p align="center">Copyright © 2008<br />
Privacy Policy - Terms of Service - About Us</p>
 <!-- end #footer --></div>
<!-- end #container --></div>

<script type="text/javascript">
<!--
var MenuBar1 = new Spry.Widget.MenuBar("MenuBar1", {imgDown:"SpryAssets/SpryMenuBarDownHover.gif", imgRight:"SpryAssets/SpryMenuBarRightHover.gif"});
//-->
</script>
</body>
</html>

Link to comment
Share on other sites

Well You need to include application_top.php for using all oscommerce functions.

 

Here You are using

one of the oscommerce functions.

 

 

Satish

Ask/Skype for Free osCommerce value addon/SEO suggestion tips for your site.

 

Check My About US For who am I and what My company does.

Link to comment
Share on other sites

Well You need to include application_top.php for using all oscommerce functions.

 

Here You are using

one of the oscommerce functions.

 

 

Satish

 

Ok thanks.

So would it be correct to add this to the top of each page?

<?php
/*
 $Id: index.php 1739 2007-12-20 00:52:16Z hpdl $

 osCommerce, Open Source E-Commerce Solutions
 http://www.oscommerce.com

 Copyright (c) 2007 osCommerce

 Released under the GNU General Public License
*/

 require('includes/application_top.php');
?>

 

As I tried this, and did it with both codes however nothing shows up.

I'm not sure what i'm doing wrong.

Link to comment
Share on other sites

the application top should not actually SHOW anything, the applications file is a functions file.. so instead of showing anything, it SHOULD make the functions for the rest of your site work properly.. did it?

A great place for newbies to start

Road Map to oscommerce File Structure

DO NOT PM ME FOR HELP. My time is valuable, unless i ask you to PM me, please dont. You will get better help if you post publicly. I am not as good at this as you think anyways!

 

HOWEVER, you can visit my blog (go to my profile to see it) and post a question there, i will find time to get back and answer you

 

Proud Memeber of the CODE BREAKERS CLUB!!

Link to comment
Share on other sites

Yeh I know it shouldn't show anything, however it didn't show the code which Satish gave me above.

Before it gave me an error, but now it just doesn't show up anything :S

I'm in need for a code which shows "Login" when they are not, and "Logout / Register" when they are.

 

Is this possible?

Thanks :D

Link to comment
Share on other sites

Ok now I have 2 other problems. Or maybe 1...

Both the Contact Us form and the Password Reset forms don't work.

It comes up message sent, but I never receive the emails. However I can send emails to customers in the /Admin thing.

Whats wrong with it?

 

Thanks

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...