chrometweaks.org

Should I host my website with iPage or x10hosting?

Click Here To View All Answers...


First off, Should I host my website with iPage or x10hosting? Thanks in advance for any answer or 2. Another question... Not sure what caused this. I just installed the newest version of OS and am beginning to input and modify. I have only removed the "review" box and the "write a reveiw" link on the products page so far. When I went to check to make sure the write a review link was really gone from the product page, I got this fatal error:.

I haven't changed any code on this page, but here's what the code is currently:.

<?php.

/*.

 $Id: database.php,v 1.21 2003/06/09 21:21:59 hpdl Exp $.

 osCommerce, Open Source E-Commerce Solutions.

 http://www.oscommerce.com.

 Copyright (c) 2003 osCommerce.

 Released under the GNU General Public License.

*/.

 function tep_db_connect($server = DB_SERVER, $username = DB_SERVER_USERNAME, $password = DB_SERVER_PASSWORD, $database = DB_DATABASE, $link = 'db_link') {.

   global $$link;.

   if (USE_PCONNECT == 'true') {.

     $$link = mysql_pconnect($server, $username, $password);.

   } else {.

     $$link = mysql_connect($server, $username, $password);.

   }.

   if ($$link) mysql_select_db($database);.

   return $$link;.

 }.

 function tep_db_close($link = 'db_link') {.

   global $$link;.

   return mysql_close($$link);.

 }.

 function tep_db_error($query, $errno, $error) {.

   die('<font color="#000000"><b>'$errno' - '$error'<br><br>'$query'<br><br><small><font color="#ff0000">[TEP STOP]</font></small><br><br></b></font>');.

 }.

 function tep_db_query($query, $link = 'db_link') {.

   global $$link;.

   if (defined('STORE_DB_TRANSACTIONS') && (STORE_DB_TRANSACTIONS == 'true')) {.

     error_log('QUERY '$query"\n", 3, STORE_PAGE_PARSE_TIME_LOG);.

   }.

   $result = mysql_query($query, $$link) or tep_db_error($query, mysql_errno(), mysql_error());.

   if (defined('STORE_DB_TRANSACTIONS') && (STORE_DB_TRANSACTIONS == 'true')) {.

      $result_error = mysql_error();.

      error_log('RESULT '$result' '$result_error"\n", 3, STORE_PAGE_PARSE_TIME_LOG);.

   }.

   return $result;.

 }.

 function tep_db_perform($table, $data, $action = 'insert', $parameters = '', $link = 'db_link') {.

   reset($data);.

   if ($action == 'insert') {.

     $query = 'insert into '$table' (';.

     while (list($columns, ) = each($data)) {.

       $query .= $columns', ';.

     }.

     $query = substr($query, 0, -2)') values (';.

     reset($data);.

     while (list(, $value) = each($data)) {.

       switch ((string)$value) {.

         case 'now()':.

           $query .= 'now(), ';.

           break;.

         case 'null':.

           $query .= 'null, ';.

           break;.

         default:.

           $query .= '\''tep_db_input($value)'\', ';.

           break;.

       }.

     }.

     $query = substr($query, 0, -2)')';.

   } elseif ($action == 'update') {.

     $query = 'update '$table' set ';.

     while (list($columns, $value) = each($data)) {.

       switch ((string)$value) {.

         case 'now()':.

           $query .= $columns' = now(), ';.

           break;.

         case 'null':.

           $query .= $columns .= ' = null, ';.

           break;.

         default:.

           $query .= $columns' = \''tep_db_input($value)'\', ';.

           break;.

       }.

     }.

     $query = substr($query, 0, -2)' where '$parameters;.

   }.

   return tep_db_query($query, $link);.

 }.

 function tep_db_fetch_array($db_query) {.

   return mysql_fetch_array($db_query, MYSQL_ASSOC);.

 }.

 function tep_db_num_rows($db_query) {.

   return mysql_num_rows($db_query);.

 }.

 function tep_db_data_seek($db_query, $row_number) {.

   return mysql_data_seek($db_query, $row_number);.

 }.

 function tep_db_insert_id() {.

   return mysql_insert_id();.

 }.

 function tep_db_free_result($db_query) {.

   return mysql_free_result($db_query);.

 }.

 function tep_db_fetch_fields($db_query) {.

   return mysql_fetch_field($db_query);.

 }.

 function tep_db_output($string) {.

   return htmlspecialchars($string);.

 }.

 function tep_db_input($string) {.

   return addslashes($string);.

 }.

 function tep_db_prepare_input($string) {.

   if (is_string($string)) {.

     return trim(tep_sanitize_string(stripslashes($string)));.

   } elseif (is_array($string)) {.

     reset($string);.

     while (list($key, $value) = each($string)) {.

       $string[$key] = tep_db_prepare_input($value);.

     }.

     return $string;.

   } else {.

     return $string;.

   }.

 }.

?>.

Any help would be much appreciated!..

Comments (128)

Good question... I dunno what is the right answer. I'll do some investigation and get back to you if I find an good answer. You should email the people at iPage as they probably know..

Comment #1

Read all the instructions again, and make sure you have them done properly. I would remove the things you have done, then after each step, look at the page by refreshing and see what you get..

Document all your changes, configurations, etc., do this in a spread sheet or in a project management file...

Comment #2

Ok, where am I looking for a possible duplicate of line 62? In that same file? I haven't touched this file at all yet. Could it be something wrong with my installation?.

I have undone everything that I did so far to make sure that it didn't cause the problem...and it's still not working..

Thanks for the help......

Comment #3

Hi,.

In /catalog/includes/application_top.php.

Also, search for the string 'tep_db_connect', and it should match exactly to what the "PHPXref' output I listed in the previous post..

I would _very_ much second what John stated, you can never over document. Because I (sort of) documented my first osC installation (all the things I did, all the minor mods, all the things I didn't need to do), the second osC installation was a breeze..

Peter..

Comment #4

You possibly have an extra call to application_top.php (in an included file) - this is the only file the function tep_db_connect is called - if the file is called twice, or the function is called elsewhere such as a contribution file then you will get that error..

If you have played with persistent connections, have another play.

Matti..

Comment #5

Neither is duplicated in application_top.php. I have not done anything but set up my basic store information in admin and remove the "reviews" box and buttons....that's seriously it...I promise! Should I scrap and reinstall?..

Comment #6

I haven't touched the persistent connections either. I did not set persistent connections in the install and haven't changed that. Ugh! What did I do? lol..

Comment #7

Ok here's what I'm seeing that is similar....

On database.php I have.

Function tep_db_connect($server = DB_SERVER, $username = DB_SERVER_USERNAME, $password = DB_SERVER_PASSWORD, $database = DB_DATABASE, $link = 'db_link') {.

   global $$link;.

And on application_top.php I have.

Tep_db_connect() or die('Unable to connect to database server!').

Could that be the problem?..

Comment #8

Hi,.

Your /catalog/includes/application_top.php should be.

64  // make a connection to the database... now.

 65    tep_db_connect() or die('Unable to connect to database server!');.

..Note the semicolon at the end..

Peter..

Comment #9

Hi,.

Can you post _all_ your mods ? .

Peter..

Comment #10

I just scrapped it...gonna try one more time. I know I didn't touch any of these files, so I'm thinking it was an install problem. Hopefully this will work!! Thanks for your help......

Comment #11

I hope that you are trying to install MS2 - the CVS snapshot may at times be broken.

Matti..

Comment #12

Not sure what caused this. I just installed the newest version of OS and am beginning to input and modify. I have only removed the "review" box and the "write a reveiw" link on the products page so far. When I went to check to make sure the write a review link was really gone from the product page, I got this fatal error:.

I haven't changed any code on this page, but here's what the code is currently:.

<?php.

/*.

 $Id: database.php,v 1.21 2003/06/09 21:21:59 hpdl Exp $.

 osCommerce, Open Source E-Commerce Solutions.

 http://www.oscommerce.com.

 Copyright (c) 2003 osCommerce.

 Released under the GNU General Public License.

*/.

 function tep_db_connect($server = DB_SERVER, $username = DB_SERVER_USERNAME, $password = DB_SERVER_PASSWORD, $database = DB_DATABASE, $link = 'db_link') {.

   global $$link;.

   if (USE_PCONNECT == 'true') {.

     $$link = mysql_pconnect($server, $username, $password);.

   } else {.

     $$link = mysql_connect($server, $username, $password);.

   }.

   if ($$link) mysql_select_db($database);.

   return $$link;.

 }.

 function tep_db_close($link = 'db_link') {.

   global $$link;.

   return mysql_close($$link);.

 }.

 function tep_db_error($query, $errno, $error) {.

   die('<font color="#000000"><b>'$errno' - '$error'<br><br>'$query'<br><br><small><font color="#ff0000">[TEP STOP]</font></small><br><br></b></font>');.

 }.

 function tep_db_query($query, $link = 'db_link') {.

   global $$link;.

   if (defined('STORE_DB_TRANSACTIONS') && (STORE_DB_TRANSACTIONS == 'true')) {.

     error_log('QUERY '$query"\n", 3, STORE_PAGE_PARSE_TIME_LOG);.

   }.

   $result = mysql_query($query, $$link) or tep_db_error($query, mysql_errno(), mysql_error());.

   if (defined('STORE_DB_TRANSACTIONS') && (STORE_DB_TRANSACTIONS == 'true')) {.

      $result_error = mysql_error();.

      error_log('RESULT '$result' '$result_error"\n", 3, STORE_PAGE_PARSE_TIME_LOG);.

   }.

   return $result;.

 }.

 function tep_db_perform($table, $data, $action = 'insert', $parameters = '', $link = 'db_link') {.

   reset($data);.

   if ($action == 'insert') {.

     $query = 'insert into '$table' (';.

     while (list($columns, ) = each($data)) {.

       $query .= $columns', ';.

     }.

     $query = substr($query, 0, -2)') values (';.

     reset($data);.

     while (list(, $value) = each($data)) {.

       switch ((string)$value) {.

         case 'now()':.

           $query .= 'now(), ';.

           break;.

         case 'null':.

           $query .= 'null, ';.

           break;.

         default:.

           $query .= '\''tep_db_input($value)'\', ';.

           break;.

       }.

     }.

     $query = substr($query, 0, -2)')';.

   } elseif ($action == 'update') {.

     $query = 'update '$table' set ';.

     while (list($columns, $value) = each($data)) {.

       switch ((string)$value) {.

         case 'now()':.

           $query .= $columns' = now(), ';.

           break;.

         case 'null':.

           $query .= $columns .= ' = null, ';.

           break;.

         default:.

           $query .= $columns' = \''tep_db_input($value)'\', ';.

           break;.

       }.

     }.

     $query = substr($query, 0, -2)' where '$parameters;.

   }.

   return tep_db_query($query, $link);.

 }.

 function tep_db_fetch_array($db_query) {.

   return mysql_fetch_array($db_query, MYSQL_ASSOC);.

 }.

 function tep_db_num_rows($db_query) {.

   return mysql_num_rows($db_query);.

 }.

 function tep_db_data_seek($db_query, $row_number) {.

   return mysql_data_seek($db_query, $row_number);.

 }.

 function tep_db_insert_id() {.

   return mysql_insert_id();.

 }.

 function tep_db_free_result($db_query) {.

   return mysql_free_result($db_query);.

 }.

 function tep_db_fetch_fields($db_query) {.

   return mysql_fetch_field($db_query);.

 }.

 function tep_db_output($string) {.

   return htmlspecialchars($string);.

 }.

 function tep_db_input($string) {.

   return addslashes($string);.

 }.

 function tep_db_prepare_input($string) {.

   if (is_string($string)) {.

     return trim(tep_sanitize_string(stripslashes($string)));.

   } elseif (is_array($string)) {.

     reset($string);.

     while (list($key, $value) = each($string)) {.

       $string[$key] = tep_db_prepare_input($value);.

     }.

     return $string;.

   } else {.

     return $string;.

   }.

 }.

?>.

Any help would be much appreciated!..

Comment #13

Hi,.

From "PHPXref" the tep_db_connect() function.

And /catalog/includes/application_top.php.

 61  // include the database functions.

 62    require (DIR_WS_FUNCTIONS'database.php');.

 63  .

 64  // make a connection to the database... now.

 65    tep_db_connect() or die('Unable to connect to database server!');.

So, ....... make sure you haven't got another line the.

Same.

As line 62..

Peter..

Comment #14


This question was taken from a support group/message board and re-posted here so others can learn from it.