Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

link code


Databuilder

Recommended Posts

Posted

I'm not clear on how sessions work, and I'm still learning PHP. I'd like to create buttons that link to login.php and create_account.php. Can someone pleae point me to the code to use to maintain state and whatever else I need to do?

 

Much Thanks,

 

Jason

Posted

<a href="<?php echo tep_href_link(FILENAME_LOGIN, '', 'SSL'); ?>"><?php echo tep_image_button('your_login_button.png'); ?></a>
<a href="<?php echo tep_href_link(FILENAME_CREATE_ACCOUNT, '', 'SSL'); ?>"><?php echo tep_image_button('your_create_account_button.png'); ?></a>

Note that this is in HTML context. Put the buttons in includes/languages/english/images/buttons (or whatever language). Change the button names as necessary/desired.

 

tep_href_link will handle the session ID for you.

 

Hth,

Matt

Posted

Thanks much for the code. Hate to ask, but any suggestions on getting it to work in define('TEXT_MAIN'? I tried escaping the single quotes, but that didn't seem to do it.

 

Would it be easier to edit index.php? Very open to suggestions.

 

Thanks,

 

Jason

Posted

I think it might be easier to edit index.php.

 

In re: the TEXT_MAIN, you could try

<a href="' . tep_href_link(FILENAME_LOGIN, '', 'SSL') . '">' . tep_image_button('your_login_button.png') . '</a>
<a href="' . tep_href_link(FILENAME_CREATE_ACCOUNT, '', 'SSL') . '">' . tep_image_button('your_create_account_button.png') . '</a>

Hth,

Matt

Archived

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

×
×
  • Create New...