DamanC Posted November 25, 2009 Posted November 25, 2009 Hi guys, Just a quick one. I have installed a SSL cert which works great aside from one little problem. I have a create a "create account link" and "login link" embedded in my header.php page. However neither link go to a https version of a page, just the http version. Now I have other links to these pages which work great, one of which is the login page. Both continue (for create account) and sign in buttons point to a https version. Obviously i need to add some kind of code to my header.php to say load the https version, but what? This is my code in my header.php file <?php if (tep_session_is_registered('customer_id')) { $acc_link = tep_href_link('account.php'); $acc_title= HEADER_TITLE_MY_ACCOUNT; } else{ $acc_link = tep_href_link('create_account.php'); $acc_title= HEADER_TITLE_CREATE_ACCOUNT; } ?> <tr><td><a href="<?php echo $acc_link;?>"><?php echo $acc_title;?></a></td></tr> <?php if (tep_session_is_registered('customer_id')) { $login_link = tep_href_link('logoff.php'); $login_title= HEADER_TITLE_LOGOFF; } else{ $login_link = tep_href_link('login.php'); $login_title= HEADER_TITLE_LOGIN; } ?> and this is the code found in the login.php which works <td align="right"><?php echo '<a href="' . tep_href_link(FILENAME_CREATE_ACCOUNT, '', 'SSL') . '">' . tep_image_button('button_continue.gif', IMAGE_BUTTON_CONTINUE) . '</a>'; ?></td> My question is what to add to the header code? Thanks
DamanC Posted November 25, 2009 Author Posted November 25, 2009 Im going to take a punt at the create account one Change tep_href_link('create_account.php') to tep_href_link(FILENAME_CREATE_ACCOUNT, '', 'SSL') Does this look right? What about the login one?
MrPhil Posted November 25, 2009 Posted November 25, 2009 $acc_link = tep_href_link('account.php', '', 'SSL'); will make the link https://... instead of http://... Do the same for your other calls to tep_href_link() where you want to use SSL. Also, why not use FILENAME_CREATE_ACCOUNT etc. instead of the actual file names?
DamanC Posted November 25, 2009 Author Posted November 25, 2009 Thanks Mr Phil, I got excited and had a crack using the FILENAME_CREATE_ACCOUNT route (EG tep_href_link(FILENAME_CREATE_ACCOUNT, '', 'SSL') and tep_href_link(FILENAME_CREATE_ACCOUNT, '', 'SSL') and it works :) Thank you for your help Finally something that has gone right today :)
WebDev22 Posted July 10, 2010 Posted July 10, 2010 I have a link that needs to point to an SSL page (HTTPS) and tried your solution but it didn't work for me. Here's what I edited in the information.php file: '<a href="' . tep_href_link(FILENAME_FINANCING,",'SSL') . '">' . BOX_INFORMATION_FINANCING . '</a><br>' .
germ Posted July 11, 2010 Posted July 11, 2010 It didn't work because in this part of the code: tep_href_link(FILENAME_FINANCING,",'SSL') You used the single character double quotation mark when it needs to be two apostrophe's togther. I know it's hard to look at a post and tell the difference. And in any programming language exact syntax is essential. I just thought you might want to know for future reference. :) If I suggest you edit any file(s) make a backup first - I'm not perfect and neither are you. "Given enough impetus a parallelogramatically shaped projectile can egress a circular orifice." - Me - "Headers already sent" - The definitive help "Cannot redeclare ..." - How to find/fix it SSL Implementation Help Like this post? "Like" it again over there >
WebDev22 Posted July 11, 2010 Posted July 11, 2010 It didn't work because in this part of the code: You used the single character double quotation mark when it needs to be two apostrophe's togther. I know it's hard to look at a post and tell the difference. And in any programming language exact syntax is essential. I just thought you might want to know for future reference. :) Thanks.
Recommended Posts
Archived
This topic is now archived and is closed to further replies.