Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

loginbox best and infobox outside Contribu. problem


davids771

Recommended Posts

I am getting this error at the bottom of my catalog after I read and made changes to all instances of "nonssl" to "ssl" for the catalog/includes/boxes/loginbox.php: (makes sense, it needs to go to my secure after logging in) BTW it works otherwise just not going to https:

 

"ERROR! Unable to determine connection method on a link!

Known methods: NONSSL SSL"

 

Oh, and all the right side boxes don't show either. As soon as I change it back to 'nonssl' it's back to normal loginbox displayed properly.

 

Second issue which I have asked on the general support page yesterday and might as well ask here too has to do with placing this loginbox best in my root index.htm page using the contribution "infoboxoutside" http://www.oscommerce.com/community/contri...infobox+outside.

 

My home site to view my problem is www.toxair.com. Please help! Thanks in advance. :thumbsup:

Link to comment
Share on other sites

You've got all the PHP code after the </head> tag, but before the <body> tag... It's dangling out there in "no man's land"...

:blink:

 

Try putting it AFTER this line in the HTML:

 

<body bgcolor="#FFFFFF" background="images/background.gif" text="#000000" link="#0000FF" vlink="#0000FF" alink="#0000FF" onLoad="MM_preloadImages('images/tab_faq_orange.gif','images/tab_contactus_orange.gif','images/tab_tests_orange.gif','images/tab_professionals_orange.gif','images/order_now_blue.gif','images/Blog-over.gif','images/About-Us-over.gif','images/Brochure-over.gif','images/Press-over.gif','images/Terms-over.gif')">

 

The link you posted doesn't work, so I can't find the install instructions.

 

It's possible the PHP code is supposed to go at the very top of the file. In that case I believe you'll need to rename it to "index.php" to get it to work.

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 >

Link to comment
Share on other sites

You've got all the PHP code after the </head> tag, but before the <body> tag... It's dangling out there in "no man's land"...

:blink:

 

Try putting it AFTER this line in the HTML:

 

<body bgcolor="#FFFFFF" background="images/background.gif" text="#000000" link="#0000FF" vlink="#0000FF" alink="#0000FF" onLoad="MM_preloadImages('images/tab_faq_orange.gif','images/tab_contactus_orange.gif','images/tab_tests_orange.gif','images/tab_professionals_orange.gif','images/order_now_blue.gif','images/Blog-over.gif','images/About-Us-over.gif','images/Brochure-over.gif','images/Press-over.gif','images/Terms-over.gif')">

 

The link you posted doesn't work, so I can't find the install instructions.

 

It's possible the PHP code is supposed to go at the very top of the file. In that case I believe you'll need to rename it to "index.php" to get it to work.

 

I tried putting the where you said, but it didn't work, pretty much the same. Then I tried putting at the top and changing to .php, which gave me a parse error.

The contribution said to put at the top, but nothing about changing it to .php.

 

I noticed that when it's index.htm and my php coding is visible at the top of the output page (but in the body), there are some hot links that show up and when you go to them, you get this kind of link address: http://www.toxair.com/%22%22 which tells me that the redirect is not working. But why?

 

As it stands now, I have http:\www.toxair.com\index.php and http:\www.toxair.com\index.htm

Neither work the loginbox outside contribution properly. What could I try next?

Link to comment
Share on other sites

Please post the link to the contribution again, and put it between "Code" or "Quoute" tags, and do the same with your "index.php" file, please.

:)

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 >

Link to comment
Share on other sites

Please post the link to the contribution again, and put it between "Code" or "Quoute" tags, and do the same with your "index.php" file, please.

:)

 

 

Like that ?

Link to comment
Share on other sites

The link is OK.

 

Copy/paste the contents of your index.php file between quote tags so I can see what's wrong with it (I hope)

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 >

Link to comment
Share on other sites

The link is OK.

 

Copy/paste the contents of your index.php file between quote tags so I can see what's wrong with it (I hope)

 

<?php

/********************************************************

CONTENT OUTSIDE OF OSC V1.1

 

Author: David Vance == Adapted for MS2 by Anthony

Date: 20. 11, 2004

 

OSC 2.2 MS2

PHP Version 4.3.2

 

This snippet is an example of placing osCommerce

content on your site outside of the OSC

directory structure.

 

It allows you to display the products_new table.

 

********************************************************/

 

//saves current working directory for later return

$cwd=getcwd();

 

//changes current working directory to osc root install directory; something like: /home/david/public_html/catalog/ but not DIR_FS_CATALOG

chdir('\hosting\webhost4life\member\dsrebro\catalog\');

 

//need all of application_top's configurations and includes; NO OUTPUT ABOVE THIS POINT!

include('includes/application_top.php');

//need the

require(DIR_WS_BOXES . 'loginbox.php');

 

//start buffering

ob_start();

 

/* BEGIN: From the loginbox.php page: */

 

if ( (!strstr($_SERVER['PHP_SELF'],'login.php')) and (!strstr($_SERVER['PHP_SELF'],'create_account.php')) and !tep_session_is_registered('customer_id') ) {

?>

<!-- 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, $newtheme, false, false);

$loginboxcontent = "

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

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

<tr>

<td align=\"center\" class=\"infoBoxContents\">

" . tep_box_greeting_top() . "

</td>

</tr>

<tr>

<td align=\"center\" class=\"infoBoxContents\">

" . BOX_LOGINBOX_EMAIL . "

</td>

</tr>

<tr>

<td align=\"center\" class=\"infoBoxContents\">

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

</td>

</tr>

<tr>

<td align=\"center\" class=\"infoBoxContents\">

" . BOX_LOGINBOX_PASSWORD . " <A HREF=\"" . tep_href_link(FILENAME_PASSWORD_FORGOTTEN, '', 'NONSSL') . "\">" . BOX_LOGINBOX_FORGOT_PASSWORD . "</A>

</td>

</tr>

<tr>

<td align=\"center\" class=\"infoBoxContents\">

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

</td>

</tr>

<tr>

<td class=\"infoBoxContents\" align=\"center\">

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

 

</td>

</tr>

<tr>

<td align=\"center\" class=\"infoBoxContents\">

" . BOX_LOGINBOX_NEW . "

</td>

</tr>

</table>

</form>

";

$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 //-->

<?php

// WebMakers.com Added: My Account Info Box

} else {

if (tep_session_is_registered('customer_id')) {

?>

 

<!-- my_account_info //-->

<tr>

<td>

<?php

$info_box_contents = array();

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

'text' => BOX_HEADING_LOGIN_BOX_MY_ACCOUNT

);

new infoBoxHeading($info_box_contents, $newtheme, false, false);

$loginboxcontent = "

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

<tr>

<td align=\"center\" class=\"loginBoxGreeting\">

" . tep_box_greeting_top() . "

</td>

</tr>

<tr>

</table>

";

$info_box_contents = array();

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

'text' => $loginboxcontent .

'<a href="' . tep_href_link(FILENAME_ACCOUNT, '', 'NONSSL') . '">' . LOGIN_BOX_MY_ACCOUNT . '</a><br>' .

'<a href="' . tep_href_link(FILENAME_ACCOUNT_EDIT, '', 'NONSSL') . '">' . LOGIN_BOX_ACCOUNT_EDIT . '</a><br>' .

'<a href="' . tep_href_link(FILENAME_ACCOUNT_HISTORY, '', 'NONSSL') . '">' . LOGIN_BOX_ACCOUNT_HISTORY . '</a><br>' .

'<a href="' . tep_href_link(FILENAME_ADDRESS_BOOK, '', 'NONSSL') . '">' . LOGIN_BOX_ADDRESS_BOOK . '</a><br>' .

'<a href="' . tep_href_link(FILENAME_ACCOUNT_NOTIFICATIONS, '', 'NONSSL') . '">' . LOGIN_BOX_PRODUCT_NOTIFICATIONS . '</a><br>' .

'<a href="' . tep_href_link(FILENAME_LOGOFF, '', 'NONSSL') . '"><b>' . LOGIN_BOX_LOGOFF . '</b></a>'

);

new infoBox($info_box_contents);

?>

</td>

</tr>

<!-- my_account_info_eof //-->

 

<?php

 

/* END: From the loginbox.php page */

 

//save it in a variable for later use

$newloginboxTable = ob_get_contents();

 

//stop buffering

ob_end_clean();

 

//replace relative image paths with absolute urls (you may not need this. i did.)

$newloginboxTable=str_replace('src="', 'src="http://www.toxair.com/catalog/',$newloginboxTable);

 

//change back to original working directory

chdir($cwd);

 

 

//********* COPY THE CODE ABOVE TO THE TOP OF THE FILE YOU WANT YOUR BOX IN *******\\

?>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

<html>

<head>

<title>AirHound™ by Toxair</title>

<meta name="description" content="Test your air quality for BOTH particles and gases. Save the professional test fee">

<meta name="keywords" content="how to get rid of mold, asthma, vacuum cleaner accessories, air sampling, HEPA filters, PM10, IAQ, particulate, mold spores, gas, air test kit, O2, CO, CO2, unhealthy air, air quality, carbon monoxide, black mold, bucket brigade, EPA indoor air quality, airstat, toxic air, air quality, testing air quality, indoor air quality, air purifier, air purifiers, toxair, benzene, tolulene, gasoline, environmental air testing, stachybotrys chartarum, toxic mold, flooded home, flooding, water damage, water quality, indoor air, air hoods, air test kit, mold test kit, fungal, spores, mold spores, dust mites, cockroach feces, cat dander, avian flu virus, smells, stinks, apnea, CPAP, breathing problems, sick building, sick building syndrome, mycotoxins, carbon dioxide tests, CO2, carbon dioxide in the air">

<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">

<script language="JavaScript" type="text/JavaScript">

<!--

function MM_swapImgRestore() { //v3.0

var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a)&&x.oSrc;i++) x.src=x.oSrc;

}

 

function MM_preloadImages() { //v3.0

var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();

var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)

if (a.indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a;}}

}

 

function MM_findObj(n, d) { //v4.01

var p,i,x; if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {

d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}

if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[n];

for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers.document);

if(!x && d.getElementById) x=d.getElementById(n); return x;

}

 

function MM_swapImage() { //v3.0

var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)

if ((x=MM_findObj(a))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}

}

//-->

</script>

<link rel="shortcut icon" href="/favicon.ico" type="image/x-icon">

<link rel="icon" href="/favicon.ico" type="image/x-icon">

<link rel="stylesheet" type="text/css" href="./catalog/stylesheet.css" /></head>

<body bgcolor="#FFFFFF" background="images/background.gif" text="#000000" link="#0000FF" vlink="#0000FF" alink="#0000FF" onLoad="MM_preloadImages('images/tab_faq_orange.gif','images/tab_contactus_orange.gif','images/tab_tests_orange.gif','images/tab_professionals_orange.gif','images/order_now_blue.gif','images/Blog-over.gif','images/About-Us-over.gif','images/Brochure-over.gif','images/Press-over.gif','images/Terms-over.gif')">

<div align="center">

<table width="740" border="0" cellspacing="0" cellpadding="0">

<tr>

<td><table width="760" height="65" border="0" cellpadding="0" cellspacing="0" background="images/top_color.gif">

<tr>

<td> </td>

</tr>

</table>

<table width="760" height="56" border="0" cellpadding="0" cellspacing="0">

<tr>

<td width="221" background="images/top_color.gif">

<div align="center"><img src="images/airhound_logo.gif" width="209" height="56"></div></td>

<td width="539" valign="bottom" background="images/top_color.gif">

<p><a href="index.htm"><img src="images/tab_home_orange.gif" name="home" width="104" height="21" border="0"></a><a href="tests_available.htm" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('tests','','images/tab_tests_orange.gif',1)"><img src="images/tab_tests_white.gif" name="tests" width="104" height="21" border="0"></a><a href="professionals.htm" onMouseOver="MM_swapImage('professionals','','images/tab_professionals_orange.gif',1)" onMouseOut="MM_swapImgRestore()"><img src="images/tab_professionals_white.gif" name="professionals" width="104" height="21" border="0" id="professionals"></a><a href="faq.htm" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('faq','','images/tab_faq_orange.gif',1)"><img src="images/tab_faq_white.gif" name="faq" width="104" height="21" border="0"></a><a href="contact_us.htm" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('contact_us','','images/tab_contactus_orange.gif',1)"><img src="images/tab_contactus_white.gif" name="contact_us" width="104" height="21" border="0"></a></p></td>

</tr>

</table>

<table width="760" border="0" cellspacing="0" cellpadding="0">

<tr>

<td><p><img src="images/people.jpg" width="760" height="160"></p>

</td>

</tr>

<tr>

<td bgcolor="#ffffff" height="388">

 

<div align="center">

<table border="0" cellpadding="0" cellspacing="0" width="720">

<tbody><tr>

<td><div align="center"><font color="#666666" face="Arial, Helvetica, sans-serif" size="4"><br>

The indoor air quality professional test for home or business you

can do yourself<br>

<br>

</font></div></td>

 

</tr>

 

<tr>

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

<tbody><tr>

<td width="121" valign="top" bgcolor="#ffffff"><p align="center"><table width=125>

<tr><td>

<?php

echo $newloginboxTable; //output your table here (or wherever)

?>

</td></tr>

</table></p>

<a href="http://airhound.blogspot.com/2007/06/3-2-1-launch-hound_02.html" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Image10','','images/Blog-over.gif',1)"><img src="images/Blog.gif" name="Image10" width="119" height="29" border="0"></a><a href="about_us.htm" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Image11','','images/About-Us-over.gif',1)"><img src="images/About-Us.gif" name="Image11" width="119" height="28" border="0"></a><a href="brochure.htm" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Image12','','images/Brochure-over.gif',1)"><img src="images/Brochure.gif" name="Image12" width="119" height="28" border="0"></a><a href="press.htm" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Image13','','images/Press-over.gif',1)"><img src="images/Press.gif" name="Image13" width="119" height="28" border="0"></a><a href="tcu.htm" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Image14','','images/Terms-over.gif',1)"><img src="images/Terms.gif" name="Image14" width="119" height="36" border="0"></a></td>

<td width="449" valign="top" bgcolor="#ffffff">

<p><font face="Arial, Helvetica, sans-serif" size="2">Toxair

introduces

AirHound™ air sampling

system. Using your vacuum cleaner

you now can obtain detailed information about the quality

of the air your breathe. AirHound™ determines the presence of contaminants such as mold spores, carbon dioxide, dust mites, carbon monoxide, and many others. And unlike other DIY test kits available, AirHound™ not only tells you if a contaminant is present, but tells you the <strong>amount</strong> of the contamination in concentration levels.

 

Now you can compare your home's air quality to standards - just like the environmental professional would. Test the air in your home with AirHound™ before buying an expensive HEPA cleaner, or check the performance of your existing ventilation system, or determine if a IAQ concern warrants further actions by understanding what exactly is the problem in your air.</font></p>

 

<p><font face="Arial, Helvetica, sans-serif" size="2"> With laboratory results in as little as 48 hours*

you can <strong>DISCOVER BETTER AIR</strong> !

</font></p>

<p align="center"> </p>

</td>

<td align="center" width="150"> <p><img src="images/sampling_kit.gif" height="139" width="71"></p>

<p><a href="catalog/index.php" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('ordernow','','images/order_now_blue.gif',1)"><img src="images/order_now_orange.gif" name="ordernow" width="103" height="17" border="0"></a></p></td>

 

</tr>

<tr>

<td bgcolor="#ffffff" valign="top"> </td>

<td bgcolor="#ffffff" valign="top"><div align="center"><font size="1" face="Arial, Helvetica, sans-serif">

</font></div></td>

<td align="center"> </td>

</tr>

</tbody></table></td>

</tr>

<tr>

<td><font face="Arial, Helvetica, sans-serif" size="1"><br>

 

<br>

TOXAIR Copyright ©2007 All rights reserved. US Pat # 6,993,985 <a href="Privacy.htm">Privacy Policy</a> <a href="tcu.htm">Conditions of Use</a> *See Order Now page for details.</font></td>

 

</tr>

</table>

 

</div></td>

</tr>

</table>

<p> </p></td>

</tr>

</table>

</div>

 

<script src="http://www.google-analytics.com/urchin.js" type="text/javascript">

</script>

<script type="text/javascript">

_uacct = "UA-212843-1";

urchinTracker();

</script>

</body>

</html>

Link to comment
Share on other sites

I see two problems:

 

This:

 

chdir('\hosting\webhost4life\member\dsrebro\catalog\');

 

Should be:

 

chdir('/hosting/webhost4life/member/dsrebro/catalog/');

 

Farther down, I think this:

 

if ( (!strstr($_SERVER['PHP_SELF'],'login.php')) and (!strstr($_SERVER['PHP_SELF'],'create_account.php')) and !tep_session_is_registered('customer_id') ) {

Should be:

 

if ( (!strstr($_SERVER['PHP_SELF'],'login.php')) && (!strstr($_SERVER['PHP_SELF'],'create_account.php')) && (!tep_session_is_registered('customer_id')) ) {

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 >

Link to comment
Share on other sites

I'm getting this now:

Parse error: parse error, unexpected '{' in c:\hosting\webhost4life\member\dsrebro\index.php on line 35

 

Line 35 is

if ( (!strstr($_SERVER['PHP_SELF'],'login.php')) && (!strstr($_SERVER['PHP_SELF'],'create_account.php')) && (!tep_session_is_registered('customer_id')) ) {

 

I also tried truncating the chdir line to /catalog/ but with same results. and made same changes in index.htm with same issues.

Edited by davids771
Link to comment
Share on other sites

I tried the original contribution code on my server with almost perfect success. It returned a error:

Warning: chdir(): No such file or directory (errno 2) in c:\hosting\webhost4life\member\dsrebro\infobox_outside.php on line 76 I suppose this means I need to put something in the parentheses of Line 20

 

$cwd=getcwd();

 

So I guess big problem is in the snippet I inserted from loginbox.php. But I have no idea where that problem is.

Here's what I tried successfully:

 

<?php
/********************************************************
CONTENT OUTSIDE OF OSC V1.1       

Author: David Vance  == Adapted for MS2 by Anthony
Date: 20. 11, 2004

OSC 2.2 MS2
PHP Version 4.3.2

This snippet is an example of placing osCommerce
 content on your site outside of the OSC 
 directory structure.

 It allows you to display the products_new table.

********************************************************/

//saves current working directory for later return
$cwd=getcwd();

//changes current working directory to osc root install directory; something like: /home/david/public_html/catalog/ but not DIR_FS_CATALOG
chdir('/hosting/webhost4life/member/dsrebro/catalog/'); 

//need all of application_top's configurations and includes; NO OUTPUT ABOVE THIS POINT!
include('includes/application_top.php');
 //need the language file
 require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_PRODUCTS_NEW);

 //start buffering
ob_start(); 

/* BEGIN: From the products_new.php page: */

 if ($random_product = tep_random_select("select products_id, products_image, products_tax_class_id, products_price from " . TABLE_PRODUCTS . " where products_status = '1' order by products_date_added desc limit " . MAX_RANDOM_SELECT_NEW)) {
?>
 <?php
   $random_product['products_name'] = tep_get_products_name($random_product['products_id']);
   $random_product['specials_new_products_price'] = tep_get_products_special_price($random_product['products_id']);

   $info_box_contents = array();
   $info_box_contents[] = array('text' => BOX_HEADING_WHATS_NEW);

   new infoBoxHeading($info_box_contents, false, false, tep_href_link(FILENAME_PRODUCTS_NEW));

   if (tep_not_null($random_product['specials_new_products_price'])) {
     $whats_new_price = '<s>' . $currencies->display_price($random_product['products_price'], tep_get_tax_rate($random_product['products_tax_class_id'])) . '</s><br>';
     $whats_new_price .= '<span class="productSpecialPrice">' . $currencies->display_price($random_product['specials_new_products_price'], tep_get_tax_rate($random_product['products_tax_class_id'])) . '</span>';
   } else {
     $whats_new_price = $currencies->display_price($random_product['products_price'], tep_get_tax_rate($random_product['products_tax_class_id']));
   }

   $info_box_contents = array();
   $info_box_contents[] = array('align' => 'center',
                                'text' => '<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $random_product['products_id']) . '">' . tep_image(DIR_WS_IMAGES . $random_product['products_image'], $random_product['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</a><br><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $random_product['products_id']) . '">' . $random_product['products_name'] . '</a><br>' . $whats_new_price);

   new infoBox($info_box_contents);

   }
?>

<?php

/* END: From the products_new.php page */

 //save it in a variable for later use
 $newProductsTable = ob_get_contents();

 //stop buffering
 ob_end_clean();

 //replace relative image paths with absolute urls (you may not need this. i did.)
$newProductsTable=str_replace('src="', 'src="http://www.toxair.com/catalog/',$newProductsTable);

 //change back to original working directory
chdir($cwd);


//********* COPY THE CODE ABOVE TO THE TOP OF THE FILE YOU WANT YOUR BOX IN *******\\
?>

<!-- ********* SAMPLE PAGE USAGE BELOW ********* -->
<html><head>

<!--make sure to include the stylesheet if you want the box to have same style as your shop-->
<link rel="stylesheet" type="text/css" href="./catalog/stylesheet.css" /> 

</head>
<body>
<center>
<table width=125>
<tr><td>
<?php 
echo $newProductsTable; //output your table here (or wherever)
?>
</td></tr>
</table>
</center>
</body>
</html>

Link to comment
Share on other sites

Try this for line 35:

 

if ( ( (!strstr($_SERVER['PHP_SELF'],'login.php')) && (!strstr($_SERVER['PHP_SELF'],'create_account.php')) ) && (!tep_session_is_registered('customer_id')) ) {

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 >

Link to comment
Share on other sites

In your "index.php" you posted, you have 13 occcurences of "{" , but only 11 "}"

 

They should be equal.

 

Recheck the install instructions and see if you can find where you missed the other 2...

:blush:

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 >

Link to comment
Share on other sites

In your "index.php" you posted, you have 13 occcurences of "{" , but only 11 "}"

 

They should be equal.

 

Recheck the install instructions and see if you can find where you missed the other 2...

:blush:

 

Ok, I'll find those }. It's odd since I grabbed it straight from infobox.php and inserted into the snippet as instructed in the contrib.

 

Any idea how to make the infobox best.php contribution in my catalog go to SSL on login (it's not) ? I tried changing as stated in my first post #1 above but that didn't work. Sorry I'm multitasking my problems but thanks again for your continued help Germ. :)

Link to comment
Share on other sites

There are 3 variations of this contribution at the link you posted.

 

Exactly which one are you trying to install?

:unsure:

 

Maybe I can help with the missing "}".

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 >

Link to comment
Share on other sites

There are 3 variations of this contribution at the link you posted.

 

Exactly which one are you trying to install?

:unsure:

 

Maybe I can help with the missing "}".

 

I am attempting to use thhe middle contrib. dated 11/20/2004.

 

I found and corrected the } problem which gave me two loginbox at the top of my index.php page for some unknown reason. I also echoed it further down at line 249 as instructions said. Also the script from lines 154-170 are showing up on the page too.

Here's the echo lines #246-252:

<td width="121" valign="top" bgcolor="#ffffff"><p align="center"><table width=125>
<tr><td>
<?php 
echo $newloginboxTable; //output your table here (or wherever)
?>
</td></tr>
</table></p>

Link to comment
Share on other sites

In the <Head> section:

 

Find:

 

<!-- loginbox_eof //-->
/* END: From the loginbox.php page */

 //save it in a variable for later use
 $newloginboxTable = ob_get_contents();

 

Change to:

 

<!-- loginbox_eof //-->
<?php 
/* END: From the loginbox.php page */

 //save it in a variable for later use
 $newloginboxTable = ob_get_contents();

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 >

Link to comment
Share on other sites

In the code you posted, delete this:

 

?>

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 >

Link to comment
Share on other sites

Now I get one loginbox at the very top and one echoing where I want it plus this error:

Warning: chdir(): No such file or directory (errno 2) in c:\hosting\webhost4life\member\dsrebro\index.php on line 165

So I just need to get rid of the top loginbox and the error and that will do it. Then it's on to the SSL problem.

Link to comment
Share on other sites

Good.

 

We're making progress. :thumbsup:

 

Please post the contents of your "index.php" file again, between "code" or "quote" tags like you did before.

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 >

Link to comment
Share on other sites

<?php
/********************************************************
CONTENT OUTSIDE OF OSC V1.1       

Author: David Vance  == Adapted for MS2 by Anthony
Date: 20. 11, 2004

OSC 2.2 MS2
PHP Version 4.3.2

This snippet is an example of placing osCommerce
 content on your site outside of the OSC 
 directory structure.

 It allows you to display the products_new table.

********************************************************/

//saves current working directory for later return
$cwd=getcwd();

//changes current working directory to osc root install directory; something like: /home/david/public_html/catalog/ but not DIR_FS_CATALOG
chdir('/hosting/webhost4life/member/dsrebro/catalog/'); 

//need all of application_top's configurations and includes; NO OUTPUT ABOVE THIS POINT!
include('includes/application_top.php');
 //need the 
 require(DIR_WS_BOXES . 'loginbox.php');

 //start buffering
ob_start(); 

/* BEGIN: From the loginbox.php page: */
if ( ( (!strstr($_SERVER['PHP_SELF'],'login.php')) && (!strstr($_SERVER['PHP_SELF'],'create_account.php')) ) && (!tep_session_is_registered('customer_id')) ) {

?>
<!-- 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, $newtheme, false, false);
   $loginboxcontent = "
           <form name=\"login\" method=\"post\" action=\"" . tep_href_link(FILENAME_LOGIN, 'action=process') . "\">
           <table border=\"0\" width=\"100%\" cellspacing=\"0\" cellpadding=\"0\">
             <tr>
               <td align=\"center\" class=\"infoBoxContents\">
             	  " . tep_box_greeting_top() . "
               </td>
             </tr>
             <tr>
               <td align=\"center\" class=\"infoBoxContents\">
                 " . BOX_LOGINBOX_EMAIL . "
               </td>
             </tr>
             <tr>
               <td align=\"center\" class=\"infoBoxContents\">
                 <input type=\"text\" name=\"email_address\" maxlength=\"96\" size=\"20\" value=\"\">
               </td>
             </tr>
             <tr>
               <td align=\"center\" class=\"infoBoxContents\">
                 " . BOX_LOGINBOX_PASSWORD . " <A HREF=\"" . tep_href_link(FILENAME_PASSWORD_FORGOTTEN, '', 'NONSSL') . "\">" . BOX_LOGINBOX_FORGOT_PASSWORD . "</A>
               </td>
             </tr>
             <tr>
               <td align=\"center\" class=\"infoBoxContents\">
                 <input type=\"password\" name=\"password\" maxlength=\"40\" size=\"20\" value=\"\">
               </td>
             </tr>
             <tr>
               <td class=\"infoBoxContents\" align=\"center\">
                 " . tep_image_submit('button_login.gif', IMAGE_BUTTON_LOGIN) . "

               </td>
             </tr>
             <tr>
               <td align=\"center\" class=\"infoBoxContents\">
             	" . BOX_LOGINBOX_NEW . "
               </td>
             </tr>
           </table>
           </form>
             ";
   $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 //-->
<?php
// WebMakers.com Added: My Account Info Box
} else {
 if (tep_session_is_registered('customer_id')) {
?>

<!-- my_account_info //-->
         <tr>
           <td>
<?php
 $info_box_contents = array();
 $info_box_contents[] = array('align' => 'left',
                              'text'  => BOX_HEADING_LOGIN_BOX_MY_ACCOUNT
                             );
 new infoBoxHeading($info_box_contents, $newtheme, false, false);
 $loginboxcontent = "
         <table border=\"0\" width=\"100%\" cellspacing=\"0\" cellpadding=\"0\">
           <tr>
             <td align=\"center\" class=\"loginBoxGreeting\">
             " . tep_box_greeting_top() . "
             </td>
           </tr>
           <tr>
         </table>
           ";
 $info_box_contents = array();
 $info_box_contents[] = array('align' => 'center',
                              'text'  => $loginboxcontent . 
				  '<a href="' . tep_href_link(FILENAME_ACCOUNT, '', 'NONSSL') . '">' . LOGIN_BOX_MY_ACCOUNT . '</a><br>' . 
                                         '<a href="' . tep_href_link(FILENAME_ACCOUNT_EDIT, '', 'NONSSL') . '">' . LOGIN_BOX_ACCOUNT_EDIT . '</a><br>' .
                                         '<a href="' . tep_href_link(FILENAME_ACCOUNT_HISTORY, '', 'NONSSL') . '">' . LOGIN_BOX_ACCOUNT_HISTORY . '</a><br>' .
                                         '<a href="' . tep_href_link(FILENAME_ADDRESS_BOOK, '', 'NONSSL') . '">' . LOGIN_BOX_ADDRESS_BOOK . '</a><br>' .
                                         '<a href="' . tep_href_link(FILENAME_ACCOUNT_NOTIFICATIONS, '', 'NONSSL') . '">' . LOGIN_BOX_PRODUCT_NOTIFICATIONS . '</a><br>' .
                                         '<a href="' . tep_href_link(FILENAME_LOGOFF, '', 'NONSSL') . '"><b>' . LOGIN_BOX_LOGOFF . '</b></a>'
      			      );
 new infoBox($info_box_contents);
?>
           </td>
         </tr>
<!-- login_box_contents eof //-->

<?php
 }
}
/* END: From the loginbox.php page */

 //save it in a variable for later use
 $newloginboxTable = ob_get_contents();

 //stop buffering
 ob_end_clean();

 //replace relative image paths with absolute urls (you may not need this. i did.)
$newloginboxTable=str_replace('src="', 'src="http://www.toxair.com/catalog/',$newloginboxTable);

 //change back to original working directory
chdir($cwd);


//********* COPY THE CODE ABOVE TO THE TOP OF THE FILE YOU WANT YOUR BOX IN *******\\
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>AirHound™ by Toxair</title>
<meta name="description" content="Test your air quality for BOTH particles and gases. Save the professional test fee">
<meta name="keywords" content="how to get rid of mold, asthma, vacuum cleaner accessories, air sampling, HEPA filters, PM10, IAQ, particulate, mold spores, gas, air test kit, O2, CO, CO2, unhealthy air, air quality, carbon monoxide, black mold, bucket brigade, EPA indoor air quality, airstat, toxic air, air quality, testing air quality, indoor air quality, air purifier, air purifiers, toxair, benzene, tolulene, gasoline, environmental air testing, stachybotrys chartarum, toxic mold, flooded home, flooding, water damage, water quality, indoor air, air hoods, air test kit, mold test kit, fungal, spores, mold spores, dust mites, cockroach feces, cat dander, avian flu virus, smells, stinks, apnea, CPAP, breathing problems, sick building, sick building syndrome, mycotoxins, carbon dioxide tests, CO2, carbon dioxide in the air">
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<script language="JavaScript" type="text/JavaScript">
<!--
function MM_swapImgRestore() { //v3.0
 var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
 var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
   var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
   if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.01
 var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
   d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
 if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
 for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
 if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
 var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
  if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
//-->
</script>
<link rel="shortcut icon" href="/favicon.ico" type="image/x-icon"> 
<link rel="icon" href="/favicon.ico" type="image/x-icon">
<link rel="stylesheet" type="text/css" href="./catalog/stylesheet.css" /></head>
<body bgcolor="#FFFFFF" background="images/background.gif" text="#000000" link="#0000FF" vlink="#0000FF" alink="#0000FF" onLoad="MM_preloadImages('images/tab_faq_orange.gif','images/tab_contactus_orange.gif','images/tab_tests_orange.gif','images/tab_professionals_orange.gif','images/order_now_blue.gif','images/Blog-over.gif','images/About-Us-over.gif','images/Brochure-over.gif','images/Press-over.gif','images/Terms-over.gif')">
<div align="center">
 <table width="740" border="0" cellspacing="0" cellpadding="0">
   <tr>
     <td><table width="760" height="65" border="0" cellpadding="0" cellspacing="0" background="images/top_color.gif">
         <tr>
           <td> </td>
         </tr>
       </table>
       <table width="760" height="56" border="0" cellpadding="0" cellspacing="0">
         <tr>
           <td width="221" background="images/top_color.gif">
<div align="center"><img src="images/airhound_logo.gif" width="209" height="56"></div></td>
           <td width="539" valign="bottom" background="images/top_color.gif"> 
           <p><a href="index.htm"><img src="images/tab_home_orange.gif" name="home" width="104" height="21" border="0"></a><a href="tests_available.htm" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('tests','','images/tab_tests_orange.gif',1)"><img src="images/tab_tests_white.gif" name="tests" width="104" height="21" border="0"></a><a href="professionals.htm" onMouseOver="MM_swapImage('professionals','','images/tab_professionals_orange.gif',1)" onMouseOut="MM_swapImgRestore()"><img src="images/tab_professionals_white.gif" name="professionals" width="104" height="21" border="0" id="professionals"></a><a href="faq.htm" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('faq','','images/tab_faq_orange.gif',1)"><img src="images/tab_faq_white.gif" name="faq" width="104" height="21" border="0"></a><a href="contact_us.htm" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('contact_us','','images/tab_contactus_orange.gif',1)"><img src="images/tab_contactus_white.gif" name="contact_us" width="104" height="21" border="0"></a></p></td>
         </tr>
       </table>
       <table width="760" border="0" cellspacing="0" cellpadding="0">
         <tr>
           <td><p><img src="images/people.jpg" width="760" height="160"></p>
           </td>
         </tr>
         <tr>
           <td bgcolor="#ffffff" height="388">

<div align="center">
               <table border="0" cellpadding="0" cellspacing="0" width="720">
                 <tbody><tr>
                   <td><div align="center"><font color="#666666" face="Arial, Helvetica, sans-serif" size="4"><br>
                       The indoor air quality professional test for home or business you 
                       can do yourself<br>
                       <br>
                       </font></div></td>

  </tr>

                 <tr>
                   <td><table border="0" cellpadding="0" cellspacing="0" width="100%">
                       <tbody><tr>
                         <td width="121" valign="top" bgcolor="#ffffff"><p align="center"><table width=125>
<tr><td>
<?php 
echo $newloginboxTable; //output your table here (or wherever)
?>
</td></tr>
</table></p>
                           <a href="http://airhound.blogspot.com/2007/06/3-2-1-launch-hound_02.html" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Image10','','images/Blog-over.gif',1)"><img src="images/Blog.gif" name="Image10" width="119" height="29" border="0"></a><a href="about_us.htm" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Image11','','images/About-Us-over.gif',1)"><img src="images/About-Us.gif" name="Image11" width="119" height="28" border="0"></a><a href="brochure.htm" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Image12','','images/Brochure-over.gif',1)"><img src="images/Brochure.gif" name="Image12" width="119" height="28" border="0"></a><a href="press.htm" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Image13','','images/Press-over.gif',1)"><img src="images/Press.gif" name="Image13" width="119" height="28" border="0"></a><a href="tcu.htm" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Image14','','images/Terms-over.gif',1)"><img src="images/Terms.gif" name="Image14" width="119" height="36" border="0"></a></td>
                         <td width="449" valign="top" bgcolor="#ffffff"> 
                           <p><font face="Arial, Helvetica, sans-serif" size="2">Toxair 
                             introduces 
                             AirHound™ air sampling 
                             system. Using your vacuum cleaner 
                             you now can obtain detailed information about the quality 
                             of the air your breathe. AirHound™ determines the presence of contaminants such as mold spores, carbon dioxide, dust mites, carbon monoxide, and many others. And unlike other DIY test kits available, AirHound™ not only tells you if a contaminant is present, but tells you the <strong>amount</strong> of the contamination in concentration levels. 

						  Now you can compare your home's air quality to standards - just like the environmental professional would. Test the air in your home with AirHound™ before buying an expensive HEPA cleaner, or check the performance of your existing ventilation system, or determine if a IAQ concern warrants further actions by  understanding what exactly is the problem in your air.</font></p>

                           <p><font face="Arial, Helvetica, sans-serif" size="2"> With laboratory results in as little as 48 hours* 
                             you can <strong>DISCOVER BETTER AIR</strong> !
</font></p>
                           <p align="center"> </p>
                           </td>
                         <td align="center" width="150"> <p><img src="images/sampling_kit.gif" height="139" width="71"></p>
                           <p><a href="catalog/index.php" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('ordernow','','images/order_now_blue.gif',1)"><img src="images/order_now_orange.gif" name="ordernow" width="103" height="17" border="0"></a></p></td>

                       </tr>
                         <tr>
                           <td bgcolor="#ffffff" valign="top"> </td>
                           <td bgcolor="#ffffff" valign="top"><div align="center"><font size="1" face="Arial, Helvetica, sans-serif">   
                             </font></div></td>
                           <td align="center"> </td>
                         </tr>
                       </tbody></table></td>
                 </tr>
                 <tr>
                   <td><font face="Arial, Helvetica, sans-serif" size="1"><br>

                       <br>
TOXAIR Copyright ©2007 All rights reserved. US Pat # 6,993,985 <a href="Privacy.htm">Privacy Policy</a> <a href="tcu.htm">Conditions of Use</a>   *See Order Now page for details.</font></td>

                 </tr>
               </table>

             </div></td>
         </tr>
       </table>
       <p> </p></td>
   </tr>
 </table>
</div>

<script src="http://www.google-analytics.com/urchin.js" type="text/javascript">
</script>
<script type="text/javascript">
_uacct = "UA-212843-1";
urchinTracker();
</script>
</body>
</html>

Link to comment
Share on other sites

Rearrange the order of these lines:

 

//need the 
require(DIR_WS_BOXES . 'loginbox.php');

//start buffering
ob_start();

To this:

 

//start buffering
ob_start(); 

//need the 
require(DIR_WS_BOXES . 'loginbox.php');

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 >

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...