toiletcake Posted September 10, 2006 Share Posted September 10, 2006 i need help fixing this script from the error im getting: Warning: file_get_contents(http://www.pureintelligence.net/catalog/build/build2.php): failed to open stream: Connection refused in /nfs/cust/3/16/17/471613/web/catalog/compbuild.php on line 97 <?php require('includes/application_top.php'); switch ($HTTP_GET_VARS['action']) { case 'add_products' : //f**king javascript nearly got me crazy //$products_count=explode("::",$_POST['recid']); //$products_qty = explode("::",$_POST['ammount']); //replaced by straight php foreach ($_POST['qty'] as $key => $value) { $products_qty[$key]=$value; } foreach ($_POST['products_id'] as $key => $value) { $products_count[$key]=$value; } for ($i = 0, $n = count($products_count); $i < $n; $i++) { $cart->add_cart($products_count[$i], $products_qty[$i], $HTTP_POST_VARS['id']); } // $cart->add_cart('214', '1', ''); tep_redirect(tep_href_link($goto,'')); break; } // get info from OSC currency tables $currency_symb_query = tep_db_query("select symbol_left, symbol_right, decimal_point, thousands_point from currencies where code='".$currency."'"); $currency_symb = tep_db_fetch_array($currency_symb_query); // check if the compbuild tables exist if( mysql_num_rows(mysql_query("SHOW TABLES LIKE 'compbuild_options'"))==1){ // if tables exist, get all category options into an array //get builder options $cbcomp_query = tep_db_query("select * from `compbuild_options`"); while ($cbcomp = tep_db_fetch_array($cbcomp_query)){ $pc_system_id= $cbcomp['pc_system_id']; $pc_system_name= $cbcomp['pc_system_name']; $pc_system_image= $cbcomp['pc_system_image']; $pc_system_language= $cbcomp['pc_system_language']; $pc_system_assembly= $cbcomp['pc_system_assembly']; $pc_template= $cbcomp['pc_template']; $pc_use_osc_cart= $cbcomp['pc_use_osc_cart']; $pc_add_tax= $cbcomp['pc_add_tax']; $pc_use_dependence= $cbcomp['pc_use_dependence']; $pc_use_software= $cbcomp['pc_use_software']; $pc_currency= $cbcomp['pc_currency']; } //get builder categories $pcount=0; $bcomp_query = tep_db_query("select * from `compbuild_categories` ORDER BY pc_category_id"); while ($bcomp = tep_db_fetch_array($bcomp_query)){ $pcid[$pcount]= $bcomp['pc_category_id']; $pccat[$pcount]= $bcomp['pc_category_name']; $pcimg[$pcount]= $bcomp['pc_category_image']; $osccat[$pcount]= $bcomp['osc_category_id']; $pcdep[$pcount]= $bcomp['pc_depends_on']; $msys_id[$pcount]= $bcomp['pc_system_id']; $presets[$pcount]= $bcomp['pc_preset_ids']; $pclang[$pcount]= $bcomp['pc_language']; $pcount++; } } else { echo "<table bgcolor=\"red\"><tr><td><font color=\"yellow\"><B>Tables may not exist, or Database Error</B></font></td></tr></table>"; } global $assemb_id; $assemb_id=$pcount; require(DIR_WS_LANGUAGES . $language . '/compbuild.php'); $breadcrumb->add(NAVBAR_TITLE, tep_href_link('compbuild.php', '', 'NONSSL')); ?> <!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN"> <html <?php echo HTML_PARAMS; ?>> <head> <meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>"> <title><?php echo TITLE; ?></title> <base href="<?php echo (getenv('HTTPS') == 'on' ? HTTPS_SERVER : HTTP_SERVER) . DIR_WS_CATALOG; ?>"> <link rel="stylesheet" type="text/css" href="stylesheet.css"> </head> <body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0"> <!-- header //--> <?php require(DIR_WS_INCLUDES . 'header.php'); ?> <!-- header_eof //--> <!-- body //--> <table style="background-position-y:123px background-attachment : fixed; background-image:url(./images/links_nav.png); background-repeat : no-repeat;" border="0" width="100%" cellspacing="3" cellpadding="3"> <tr> <td width="<?php //echo BOX_WIDTH; ?>212px" valign="top"><table border="0" width="<?php //echo BOX_WIDTH; ?>212px" cellspacing="0" cellpadding="0"> <!-- left_navigation //--> <?php require(DIR_WS_INCLUDES . 'column_left.php'); ?> <!-- left_navigation_eof //--> </table></td> <!-- body_text //--> <td width="100%" valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="0"> <tr> <td><table border="0" width="100%" cellspacing="0" cellpadding="0"> <tr> <link rel="STYLESHEET" type="text/css" href="build/builder<?php if ($pc_template) echo $pc_template;?>.css"> <?php echo file_get_contents(HTTP_SERVER.DIR_WS_HTTP_CATALOG."build/build2.php");?> </head> <BODY bgcolor="#FFFFFF" text="#000000" link="#0033CC" vlink="#0033CC" style="margin: 0 0 0 0;"> <div style="OVERFLOW: auto; display: none; position: absolute; border: solid 1; background-color: White; z-index: auto;" id=oFrame></div> <h2 align="center"><?php echo TEXT_TITLE; ?></h2> <div align=center> <span id=loadstr><br><br><br><br><br><br><?php echo TEXT_LOADING_PLEASE_WAIT; ?> <img src="build/pbar.gif" width="71" height="11" alt="" border="0"></span> <br> <table width="100%"> <tr> <td width="100%" class="td_none" align="center"> <script language="JavaScript"> var tlines=27; var currency = "<?php echo $currency;?>"; var currency_left="<?php echo $currency_symb['symbol_left'];?>"; var currency_right="<?php echo $currency_symb['symbol_right'];?>"; if (currency_left=="?"||currency_left=="?"){ currency_left="?"; } if (currency_right=="?"||currency_right=="?"){ currency_right="?"; } l = new Array(tlines); for (i=0;i<tlines;i++){ l = new Array(100); } //--------------------- Adding Product To The List ------------------------- recoded by meisterbartsch function add_product(ipid,ipname,iprice,irecid,row){ iprice2 = iprice; iprice = decimal_substitution(iprice,'calc'); row++; var enable=false; if (ipid=='-1'){ enable=true; ipid=""; } ipname = ipname.replace(/:inc:/gi, '"') ipname = ipname.replace(/:tag:/gi, '\'') var prods_row = document.getElementById("prod_table").rows[row]; var title_cell=prods_row.cells[1].childNodes[0].childNodes[0].childNodes[0].cells[0] ; var price_cell=prods_row.cells[2]; if (!ipname){ title_cell.innerHTML=default_line; price_cell.innerHTML=""; }else{ title_cell.innerHTML="?"+ipname; price_cell.innerHTML=currency_left+" "+iprice2+" "+currency_right; } price[row]=iprice; product[row]=ipname; pid[row]=ipid; recid[row]=irecid; if (!enable) document.getElementById("oFrame").style.display="none"; calc_total_tmp(document.mainform); } //----------------- Format float number (2 digits after dot) --------------- function formatnumber(num,num_after_dot){ if (!num_after_dot) num_after_dot=2; if (num<0.05) num=0; var snum = (String) (num); var is_dot_ok=snum.indexOf('.') if (!(is_dot_ok==-1)){ snum = snum.substr(0,is_dot_ok+num_after_dot+1); if ((snum.length-is_dot_ok)==2){ snum=snum+"0" }else{ if ((snum.length-is_dot_ok)==1){ snum=snum+"00" } } } return decimal_substitution(snum,'display'); } //----------------- Substitude Decimalsigns for display and calculation --------------- by meisterbartsch function decimal_substitution(num,direction){ switch (direction){ case 'calc': num = num.replace("<?php echo $currency_symb['thousands_point'];?>","#|#"); num = num.replace("<?php echo $currency_symb['decimal_point'];?>","."); num = num.replace("#|#",","); break; case 'display': num = num.replace(",","#|#"); num = num.replace(".","<?php echo $currency_symb['decimal_point'];?>"); num = num.replace("#|#","<?php echo $currency_symb['thousands_point'];?>"); break; } return num; } <?php $output = $pcount; for ($ib = 0; $ib < $output; $ib++) { $cat = $osccat[$ib]; echo $textshow[$cat]; } ?> </script> <?php echo tep_draw_form('mainform', tep_href_link(FILENAME_PRODUCT_INFO, tep_get_all_get_params(array('action')) . 'action=add_products')); ?> <table id='prod_table' name='prod_table' border='0' cellspacing='0' style='border-collapse: collapse' bordercolor='#628AC5'> <tr width="100%"> <th width='28%' height='35'><?php echo TEXT_PART_TYPE; ?></th> <th width="63%"><?php echo TEXT_PART_NAME; ?></th> <th width='14%'><?php echo TEXT_PRICE; ?></th> <th width='5%'><?php echo TEXT_QUANTITY; ?></th> </tr> <script language="JavaScript"> var text_please_wait="<?php echo TEXT_LOADING_PLEASE_WAIT; ?>"; var note1=" <font color=#FF0000><b><?php echo TEXT_PLEASE_SELECT_CPU; ?></b></font>"; var note2=" <font color=#FF0000><b><?php echo TEXT_PLEASE_SELECT_MOTHER_BOARD; ?></b></font>"; var note3=" <font color=#FF0000><b><?php echo TEXT_PLEASE_SELECT_MOTHER_BOARD; ?></b></font>"; var text_no_items="<?php echo TEXT_NO_ITEMS; ?>"; var text_deselect_items="<?php echo TEXT_DESELECT_ITEM; ?>"; document.getElementById("loadstr").innerHTML=""; <?php $c_java = 0; $output = $pcount; for ($ib = 0; $ib < $output; $ib++) { $cat = $pccat[$ib]; $picname = $pcimg[$ib]; ?> print_field('<?php echo $cat;?>','<?php echo $c_java;?>','<?php echo $ib;?>','<?php echo $picname;?>',<?php echo $assemb_id;?>); <?php $c_java++; } ?> //<!-- add assembly if its not free --> <?php //if ($pc_system_assembly != "0.00") { ?> print_field('<?php echo ASSEMBLY; ?>','<?php echo $c_java;?>','<?php echo $ib;?>','assembly.gif',<?php echo $assemb_id;?>); <?php //if ($ADD_ASSEMBLY==1) // { // echo '????'.$pc_system_assembly ; // } //} ?> </script> </b> </td> </tr> </table> <table width="100%" id='prod_table' name='prod_table' border='0' cellspacing='0' style='border-collapse: collapse' bordercolor='#628AC5'> <input type="hidden" name="select1" onchange="calc_subtotal(mainform);calc_total(mainform);" size="4" multiple style="width=330"> <input type=hidden name="sum"> <tr onClick="oFrame.style.display='none'"> <td width='80%' class=th_inv align="right"><span style="font: bold 14pt;"><?php echo TEXT_TOTAL_PRICE." : "; ?></span></td> <td class=th_inv align="center"><input type=text size=10 name="totsum" readonly class="trans" style="font: bold 14pt;"></td> <td width='8%' class=th_inv></td> </tr> </table> <br> <table border="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#628AC5" onClick="oFrame.style.display='none';"> <tr> <th colspan="4"><input type="button" value="<?php echo TEXT_PRINT_PREVIEW; ?>" onClick="mainform_onsubmit(mainform,1,<?php echo $c_java;?>);" class="button"> <input type="button" value="<?php echo TEXT_MAKE_ORDER; ?>" onClick="mainform_onsubmit(mainform,2,<?php echo $c_java;?>);" class="button"></th> </tr> </table> </td> </tr> </table> <input type=hidden name="price"> <input type=hidden name="product"> <input type=hidden name="pid"> <input type=hidden name="recid"> <input type=hidden name="ammount"> </form> </div> </tr> </tr></tr> </table></td> <!-- body_text_eof //--> <td width="<?php echo BOX_WIDTH; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="0" cellpadding="2"> <!-- right_navigation //--> <?php require(DIR_WS_INCLUDES . 'column_right.php'); ?> <!-- right_navigation_eof //--> </table></td> </tr> </table> <!-- body_eof //--> <!-- footer //--> <?php require(DIR_WS_INCLUDES . 'footer.php'); ?> <!-- footer_eof //--> <br> </body> </html> <?php require(DIR_WS_INCLUDES . 'application_bottom.php'); ?> Link to comment Share on other sites More sharing options...
♥Vger Posted September 10, 2006 Share Posted September 10, 2006 Well, thanks for posting 285 lines of code - but you don't honestly expect someone to go through it all for you? In any event I doubt that the problem is in the code, because the error says that the "connection was refused". Vger Link to comment Share on other sites More sharing options...
toiletcake Posted September 10, 2006 Author Share Posted September 10, 2006 Well, thanks for posting 285 lines of code - but you don't honestly expect someone to go through it all for you? In any event I doubt that the problem is in the code, because the error says that the "connection was refused". Vger thanks for the effort to find the solution to the problem maybe you can tell me how to make it not refuse thank you. :) i am trying another type of pc builder and this is the error i get. Warning: session_start(): Cannot send session cache limiter - headers already sent (output started at /nfs/cust/3/16/17/471613/web/catalog/admin/includes/functions/database.php:155) in /nfs/cust/3/16/17/471613/web/catalog/admin/includes/functions/sessions.php on line 67 im using the ccc9.3 version of pc builder can anyone find out what i need to do to fix this problem. thank you. ;) Link to comment Share on other sites More sharing options...
♥Vger Posted September 10, 2006 Share Posted September 10, 2006 The error is referencing line 97 of compbuild.php, so that's the best place to start looking. Download and install a good plain text editor like Text Pad, which will show you the numbers of each line. Vger Link to comment Share on other sites More sharing options...
toiletcake Posted September 10, 2006 Author Share Posted September 10, 2006 The error is referencing line 97 of compbuild.php, so that's the best place to start looking. Download and install a good plain text editor like Text Pad, which will show you the numbers of each line. Vger im getting this error: Products Image: Products URL: (without http://) Products Weight: Dependences: 1064 - You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near ') or (product2_id = )) and pd1.language_id =1 and pd2.language_ SELECT product1_id as p1id, pd1.products_name as p1name, catdes.categories_name as p1cat, product2_id as p2id, pd2.products_name as p2name, catdes2.categories_name as p2cat FROM compbuild_dependence as cd INNER JOIN products_description as pd1 on pd1.products_id = cd.product1_id INNER JOIN products_description as pd2 on pd2.products_id = cd.product2_id INNER JOIN products_to_categories as ptc on ptc.products_id = product1_id INNER JOIN categories_description as catdes on catdes.categories_id = ptc.categories_id INNER JOIN products_to_categories as ptc2 on ptc2.products_id = product2_id INNER JOIN categories_description as catdes2 on catdes2.categories_id = ptc2.categories_id WHERE ((product1_id = ) or (product2_id = )) and pd1.language_id =1 and pd2.language_id =1 and catdes.language_id=1 and catdes2.language_id=1 [TEP STOP] Categoty: cd Agregar Relacion Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.